title: Converting Rails 2.3 to Rails 4.0 environment.rb
body: <p>I have an application that runs fine under Rails 2.3.2.
  I'm trying to upgrade it to Rails 4.0, using nginx and unicorn.</p>
  
  <p>My config/environment.rb has these lines that don't work:</p>
  
  <pre><code>Rails::Initializer.run do |config|
    config.load_paths += %W( #{RAILS_ROOT}/vendor/gems/ #{RAILS_ROOT}/app/exceptions/ )
    config.action_controller.session = { :session_key =&gt; "my_app", :secret =&gt; "c4c6eee57d9af4f2e1a9c56a49d974b7" }
  
    config.gem "mocha", :version =&gt; '&gt;=0.9.4'
  </code></pre>
  
  <p>The error message I get in unicorn.log is</p>
  
  <pre><code>ERROR -- : uninitialized constant Rails (NameError)
  /home/art/config/environment.rb:70:in `&lt;top (required)&gt;'
  </code></pre>
  
  <p>and line 70 is the " Rails::Initializer.run do |config|" line above.</p>
  
  <p>I guess these things have been moved out into some initializer file somewhere?
  I guess bundler now handle gem versions, so I should just move the "config.gem... :version ..." lines into my Gemfile?
  And where should I set session_key?</p>
  
  <p>Thanks for any advice.</p>