RoR `const_missing' error

software development

#1

Hello,

I’m running the Mephisto blog under rails. A while ago a wrote a little script to bulk load image assets outside of the rails environment (in order to avoid having the process sniper kill my web server process while it’s uploading and resizing a bunch of large photos.) I haven’t run it since Dec 27th, 2007, at which point it worked, but it no longer does. At the suggestion of customer support, I ran ‘rake rails:freeze:edge TAG=rel_1-2-6’ to no avail.

The exact error is when I try to ‘require’ the ‘config/environment’ script to get all the rails-y goodness outside of rails:

$ ~/bin/load_image_assets.rb
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:478:in const_missing': uninitialized constant ActionController::Base::Reloadable (NameError) from /home/.pizza/<user>/<site>/http/vendor/rails/actionpack/lib/action_controller/base.rb:212 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in new_constants_in' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from /home/.pizza///http/vendor/rails/actionpack/lib/action_controller.rb:37
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require' ... 13 levels... from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in new_constants_in' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from /home//bin/load_image_assets.rb:133

Google didn’t have much on the topic, but I did find one post suggesting this was due to not having actionwebservice, which I have installed (and the system also has installed at the latest rev), but regardless, I tried updating my copy, but the gems update always gets killed by the system.

Any suggestions?


#2

Never mind, found the issues. I had to update “require ‘activerecord’” to the newer syntax: “gem ‘activerecord’”.