title: Replacing RAILS_ROOT with Rails.root
body: <p>I want to replace the deprecated RAILS_ROOT with Rails.root as part of the process of getting the application ready to upgrade to Rails 3.
  The application is currently running with version 2.3.14 and was originally created in 1.2</p>
  
  <p>At the beginning of my boot.rb file is the line:</p>
  
  <p>RAILS_ROOT = "#{File.dirname(<strong>FILE</strong>)}/.." unless defined?(RAILS_ROOT)</p>
  
  <p>I cant just substitute Rails.root here as Rails is undefined.</p>
  
  <p>What is the recommended way of setting Rails.root?</p>
  
  <p>I dont think I made the question clear enough.</p>
  
  <ul>
  <li>I am aware that Rails.root already exists in Rails 2.</li>
  <li>I can use Rails.root in my code quite happily.</li>
  <li><p>BUT I dont know how to SET Rails.root at startup. I currently appears
  to be set right at the top of boot.rb with the line:</p>
  
  <p>RAILS_ROOT = "#{File.dirname(<strong>FILE</strong>)}/.." unless defined?(RAILS_ROOT)</p></li>
  <li><p>I CANT just change that line to use Rails.root as I will get the
  error:</p>
  
  <p>../config/boot.rb:3: uninitialized constant Rails (NameError)</p></li>
  </ul>
  
  <p>Thanks
  George</p>