title: rails - running production mode locally = No such file to load - config/environment
body: <p>I am trying to run locally in production mode with:</p>
  
  <pre><code>$ RAILS_ENV=production rails s
  </code></pre>
  
  <p>But I get:</p>
  
  <pre><code>/home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/li
  b/active_support/dependencies.rb:306:in `rescue in depend_on': No such file
   to load -- /home/durrantm/Dropnot/webs/rails_apps/linker/app/assets/../con
  fig/environment (LoadError)
  </code></pre>
  
  <p>I can create a brand new rails <code>3.1.8</code> app and do <code>RAILS_ENV=production rails server</code> and I don't get this problem.</p>
  
  <p>I can also do <code>rails s</code> and that runs the server fine in development mode without error.</p>
  
  <p>I can also do <code>RAILS_ENV=development rails s</code> and that runs the server fine in development mode without error.</p>
  
  <p>fwiw, my app was originally a rails <code>2.3</code> app so perhaps I am missing something that's been added or changed in rails ?</p>
  
  <p>I do have the <code>config</code> directory with an <code>environment.rb</code> file.  Perhaps the way it's being referenced is wrong somehow?</p>
  
  <p>I added <code>config.assets.enabled = true</code> to <code>config/application.rb</code> but it didn't help (didn't expect it to as that is asset compilation, but it was a difference I found!).</p>
  
  <p>Full Trace:</p>
  
  <pre><code>durrantm@Castle2012:~/Dropnot/webs/rails_apps/linker/config/environments (v3.1.8_with_assets)
  $ RAILS_ENV=production rails s
  =&gt; Booting WEBrick
  =&gt; Rails 3.1.8 application starting in production on http://0.0.0.0:3000
  =&gt; Call with -d to detach
  =&gt; Ctrl-C to shutdown server
  Exiting
  /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:306:in `rescue in depend_on': No such file to load -- /home/durrantm/Dropnot/webs/rails_apps/linker/app/assets/../config/environment (LoadError)
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:301:in `depend_on'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:214:in `require_dependency'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/engine.rb:417:in `block (2 levels) in eager_load!'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/engine.rb:416:in `each'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/engine.rb:416:in `block in eager_load!'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/engine.rb:414:in `each'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/engine.rb:414:in `eager_load!'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/application/finisher.rb:51:in `block in &lt;module:Finisher&gt;'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/initializable.rb:30:in `instance_exec'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/initializable.rb:30:in `run'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/initializable.rb:55:in `block in run_initializers'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/initializable.rb:54:in `each'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/initializable.rb:54:in `run_initializers'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/application.rb:96:in `initialize!'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
          from /home/durrantm/Dropnot/webs/rails_apps/linker/config/environment.rb:5:in `&lt;top (required)&gt;'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `require'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `block in require'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:223:in `block in load_dependency'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:640:in `new_constants_in'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:223:in `load_dependency'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `require'
          from /home/durrantm/Dropnot/webs/rails_apps/linker/config.ru:4:in `block in &lt;main&gt;'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize'
          from /home/durrantm/Dropnot/webs/rails_apps/linker/config.ru:1:in `new'
          from /home/durrantm/Dropnot/webs/rails_apps/linker/config.ru:1:in `&lt;main&gt;'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/rack-1.3.6/lib/rack/builder.rb:40:in `eval'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/rack-1.3.6/lib/rack/builder.rb:40:in `parse_file'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/rack-1.3.6/lib/rack/server.rb:200:in `app'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/commands/server.rb:46:in `app'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/rack-1.3.6/lib/rack/server.rb:301:in `wrapped_app'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/rack-1.3.6/lib/rack/server.rb:252:in `start'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/commands/server.rb:70:in `start'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/commands.rb:54:in `block in &lt;top (required)&gt;'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/commands.rb:49:in `tap'
          from /home/durrantm/.rvm/gems/ruby-1.9.3-p194@linker/gems/railties-3.1.8/lib/rails/commands.rb:49:in `&lt;top (required)&gt;'
          from script/rails:6:in `require'
          from script/rails:6:in `&lt;main&gt;'
  </code></pre>