I suspect that most font-lock problems like this are caused by the
internal use of ruby-mode-hook in ruby-mode.el. Suppose your .emacs
file contains

(autoload 'ruby-mode "ruby-mode"
  "Mode for editing ruby source files" t)
(add-hook 'ruby-mode-hook 'turn-on-font-lock)

Because your hook is added before ruby-mode is actually loaded on
demand, the resulting ruby-mode-hook will be

((lambda nil
   (make-local-variable 'font-lock-defaults)
   (make-local-variable 'font-lock-keywords)
   (make-local-variable 'font-lock-syntax-table)
   (make-local-variable 'font-lock-syntactic-keywords)
   (setq font-lock-defaults
	 '((ruby-font-lock-keywords)
	   nil nil))
   (setq font-lock-keywords ruby-font-lock-keywords)
   (setq font-lock-syntax-table ruby-font-lock-syntax-table)
   (setq font-lock-syntactic-keywords
	 ruby-font-lock-syntactic-keywords))
 turn-on-font-lock)

Suppose instead that your .emacs file contained

(require 'ruby-mode)
(add-hook 'ruby-mode-hook 'turn-on-font-lock)

That seems harmless enough, but now ruby-mode adds its hook before you
add yours, and ruby-mode-hook becomes

(turn-on-font-lock
 (lambda nil
   (make-local-variable 'font-lock-defaults)
   (make-local-variable 'font-lock-keywords)
   (make-local-variable 'font-lock-syntax-table)
   (make-local-variable 'font-lock-syntactic-keywords)
   (setq font-lock-defaults
	 '((ruby-font-lock-keywords)
	   nil nil))
   (setq font-lock-keywords ruby-font-lock-keywords)
   (setq font-lock-syntax-table ruby-font-lock-syntax-table)
   (setq font-lock-syntactic-keywords
	 ruby-font-lock-syntactic-keywords)))

For many people running GNU Emacs, that won't work properly. They'll
need to toggle font-lock off and on again to get the desired behavior.

Here's an excerpt from the GNU Emacs documentation:

31.2.3 Hooks
------------
"With rare exceptions, hooks in Emacs are empty when Emacs starts up,
so the only hook functions in any given hook are the ones you
explicitly put there as customization.
....
It is best to design your hook functions so that the order in which
they are executed does not matter.  Any dependence on the order is
'asking for trouble.'"

To avoid this problem in the future, it would be nice if ruby-mode.el
could perform its font-lock initialization without using
ruby-mode-hook.

- Mike