RAILS_ROOT require?

10,318

Yes, you should require the environment.rb:

require File.dirname(__FILE__) + '/../config/environment.rb'
puts RAILS_ROOT

And Rails.root instead.

Share:
10,318

Related videos on Youtube

mportiz08
Author by

mportiz08

Updated on October 11, 2020

Comments

  • mportiz08
    mportiz08 over 3 years

    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?

    • Bernard Banta
      Bernard Banta almost 12 years
      You don't have to include require File.dirname(__FILE__) + '/../config/environment.rb'
  • K.-Michael Aye
    K.-Michael Aye over 11 years
    I get this error when trying to install Redmine, but I don't understand the answer. :( Where do I have to do what? "Require"?