Rails LoadError

software development

#1

Hi, for the past few days, my site goes down a couplle times a day and when it does I get an error like that below in my prod.log. If I reload the main index page a few times the app eventually recovers and loads properly but I’d like to know what is causing this to happen in the first place and how to resolve it. Can anyone decipher this error here? I have changed nothing with my app for a couple months so I don’t know why it would start happening now. Thanks.

LoadError (Expected …/config/…/app/models/castle.rb to define Castle):
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:249:in load_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:inconst_missing’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:464:in const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:260:inload_missing_constant’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:468:in const_missing' /app/controllers/castle_controller.rb:7:inindex’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:inperform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in call_filter' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:incall_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:449:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:incall_filter’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:insend’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:inprocess_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:inprocess’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:168:inprocess_request’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:143:in process_each_request!' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:109:inwith_signal_handler’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:142:in process_each_request!' /usr/lib/ruby/1.8/fcgi.rb:600:ineach_cgi’
/usr/lib/ruby/1.8/fcgi.rb:597:in each' /usr/lib/ruby/1.8/fcgi.rb:597:ineach_cgi’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:141:in process_each_request!' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:55:inprocess!’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:25:in `process!'
dispatch.fcgi:24


#2

Hi there,

I am getting the same error, having just moved my rails app to Dreamhost from being hosted locally. The only difference is that it is now running in production mode, using fcgi. Were you ever able to figure out a fix?

Thanks!


#3

I’m currently using both of these. The dreamhost plugin and the fcgimaint.rb. This has cut the errors to almost none.

http://gabrito.com/post/ruby-on-rails-dreamhost-plugin

http://gabrito.com/post/keeping-ruby-on-rails-running-at-dreamhost

Even with these, I still get occasional errors. Oddly enough it seems like some deploys cause more of these errors than others (even if the code doesn’t change) so if I see a a lot of them over a few days I try to deploy again which seems to drop the number back to about zero. Or this part could just be my imagination…