I'm trying to access the RAILS_ROOT constant in a file residing in the /lib directory, but I'm not able to (uninitialized constant error). Is there something that I need to require to be able to do this? Sorry if this is a dumb question..
+2
A:
Yes, you should require the environment.rb:
require File.dirname(__FILE__) + '/../config/environment.rb'
puts RAILS_ROOT
And Rails.root
instead.
Leventix
2010-05-29 00:29:23
thanks so much!
mportiz08
2010-05-29 00:34:07