title: ActiveSupport Dependency (load_missing_constant) Error - Expected ... to define (Load Error)
body: <p>Trying to create an Observer in rails, and getting an error { /active_support/dependencies.rb:503: in 'load_missing_constant': Expected  to define  (LoadError) }</p>
  
  <p>Using Rails 3.2.6, with Ruby 1.9.3-p194 (rvm on Lion).</p>
  
  <p>Commenting this line in application.rb prevents the error (but also the intended behavior)
  config.active_record.observers = :page_observer</p>
  
  <p>Full output of 'rails server' command:</p>
  
  <pre><code>=&gt; Booting WEBrick
  =&gt; Rails 3.2.6 application starting in development on http://0.0.0.0:3000
  =&gt; Call with -d to detach
  =&gt; Ctrl-C to shutdown server
  Exiting
  /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:503:in 'load_missing_constant': Expected /Users/d/Dropbox/Projects/Postsocial/postsocial/app/models/page.rb to define Page (LoadError)
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:192:in 'block in const_missing'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in 'each'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in 'const_missing'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:514:in 'load_missing_constant'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:192:in 'block in const_missing'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in 'each'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in 'const_missing'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/app/models/page_observer.rb:2:in '&lt;class:PageObserver&gt;'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/app/models/page_observer.rb:1:in '&lt;top (required)&gt;'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:469:in 'load'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:469:in 'block in load_file'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:639:in 'new_constants_in'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:468:in 'load_file'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:353:in 'require_or_load'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:502:in 'load_missing_constant'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:192:in 'block in const_missing'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in 'each'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in 'const_missing'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/inflector/methods.rb:229:in 'block in constantize'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/inflector/methods.rb:228:in 'each'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/inflector/methods.rb:228:in 'constantize'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/core_ext/string/inflections.rb:54:in 'constantize'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activemodel-3.2.6/lib/active_model/observing.rb:86:in 'instantiate_observer'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activemodel-3.2.6/lib/active_model/observing.rb:59:in 'block in instantiate_observers'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activemodel-3.2.6/lib/active_model/observing.rb:59:in 'each'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activemodel-3.2.6/lib/active_model/observing.rb:59:in 'instantiate_observers'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/railtie.rb:117:in 'block (2 levels) in &lt;class:Railtie&gt;'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in 'instance_eval'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in 'execute_hook'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:in 'block in run_load_hooks'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in 'each'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in 'run_load_hooks'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/base.rb:721:in '&lt;top (required)&gt;'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/app/models/page.rb:1:in '&lt;top (required)&gt;'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:469:in 'load'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:469:in 'block in load_file'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:639:in 'new_constants_in'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:468:in 'load_file'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:353:in 'require_or_load'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:502:in 'load_missing_constant'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:192:in 'block in const_missing'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in 'each'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:190:in 'const_missing'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/config/routes.rb:60:in 'block in &lt;top (required)&gt;'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:282:in 'instance_exec'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:282:in 'eval_block'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:260:in 'draw'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/config/routes.rb:1:in '&lt;top (required)&gt;'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in 'load'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in 'block in load'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in 'load_dependency'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in 'load'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in 'block in load_paths'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in 'each'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in 'load_paths'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:16:in 'reload!'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:26:in 'block in updater'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/file_update_checker.rb:78:in 'call'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/file_update_checker.rb:78:in 'execute'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:27:in 'updater'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:7:in 'execute_if_updated'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application/finisher.rb:66:in 'block in &lt;module:Finisher&gt;'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/initializable.rb:30:in 'instance_exec'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/initializable.rb:30:in 'run'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/initializable.rb:55:in 'block in run_initializers'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/initializable.rb:54:in 'each'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/initializable.rb:54:in 'run_initializers'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/application.rb:136:in 'initialize!'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in 'method_missing'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/config/environment.rb:5:in '&lt;top (required)&gt;'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/config.ru:4:in 'require'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/config.ru:4:in 'block in &lt;main&gt;'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in 'instance_eval'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in 'initialize'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/config.ru:1:in 'new'
  from /Users/d/Dropbox/Projects/Postsocial/postsocial/config.ru:1:in '&lt;main&gt;'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:40:in 'eval'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:40:in 'parse_file'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:200:in 'app'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands/server.rb:46:in 'app'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:301:in 'wrapped_app'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:252:in 'start'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands/server.rb:70:in 'start'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:55:in 'block in &lt;top (required)&gt;'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:50:in 'tap'
  from /Users/d/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:50:in '&lt;top (required)&gt;'
  from script/rails:6:in 'require'
  from script/rails:6:in '&lt;main&gt;'
  </code></pre>
  
  <p>Content of page_observer.rb</p>
  
  <pre><code>class PageObserver &lt; ActiveRecord::Observer
  end
  </code></pre>
  
  <p>Content of page.rb</p>
  
  <pre><code>class Page &lt; ActiveRecord::Base
    attr_accessible :content, :page_style, :slug, :title
  end
  </code></pre>
  
  <p>Any thoughts would be appreciated.</p>