0

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).

Mike
  • 121
  • 3

2 Answers2

0

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?

tomcopeland
  • 171
  • 2
0

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

File.expand_path('/lib/formats.rb')

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.

mltsy
  • 322
  • 2
  • 10