Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am deploying my app with capistrano/passenger/nginx. The deployment goes well. However, the app dies when I try to load it:

Error message: uninitialized constant Object::Rails

The last line of the backtrace is:

/opt/app/releases/20101208120133/system/config/environment.rb   1   in `'

This corresponds to the following:

require "#{Rails.root}/lib/formats.rb"

However, if I enter rails console on the server, it detects Rails.root just fine. I am running rails 3.0.3 (although it doesnt work for 3.0.0 either).

share|improve this question

I'm surprised to see that the stacktrace indicates that environment.rb is located in system/config/. Do you have it symlinked to current/config/environment.rb?

share|improve this answer

I had the same problem, and I had to use File.expand_path instead.


My best guess at the reason for this is that because environment.rb is one of the first things that gets loaded, maybe passenger is looking at it before it knows about the Rails object or something. It doesn't make a lot of sense... maybe I'm way off :) But this workaround seems to work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.