Rails - start up locally = no such file to load - config / environment

I am trying to run locally in production mode with:

$ RAILS_ENV=production rails s

But I get:

/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)

I can create a completely new rails application 3.1.8and do RAILS_ENV=production rails server, and I am not getting this problem.

I can also do rails s, and it works fine in development mode without errors.

I can also do RAILS_ENV=development rails s, and it works fine in development mode without errors.

fwiw, my application was originally a rail 2.3, so maybe I am missing something that has been added or changed in rails?

I have a directory configwith a file environment.rb. Perhaps somehow the link to it is incorrect?

I added config.assets.enabled = truein config/application.rb, but it did not help (I did not expect this to be a compilation of assets, but that was the difference I found!).

:

durrantm@Castle2012:~/Dropnot/webs/rails_apps/linker/config/environments (v3.1.8_with_assets)
$ RAILS_ENV=production rails s
=> Booting WEBrick
=> Rails 3.1.8 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> 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 <module:Finisher>'
        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 `<top (required)>'
        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 <main>'
        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 `<main>'
        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 <top (required)>'
        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 `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
+3
2

. config/environments/production.rb () -. .

+3

, assets (, public), app/assets, , environment.rb. .

+1

All Articles