我从头开始创建了一个新的 rails 4beta1 应用程序(ruby 2.0),当我在开发模式下启动 de 服务器时它运行良好,但是当我在生产环境中尝试时却没有。
我已经尝试在文件中运行bundle exec rake assets:precompile RAILS_ENV=production
并将其更改config.serve_static_assets
为 true,config/environments/production
但仍然出现错误:
=> Booting WEBrick
=> Rails 4.0.0.beta1 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-04-03 11:53:46] INFO WEBrick 1.3.1
[2013-04-03 11:53:46] INFO ruby 2.0.0 (2013-02-24) [x86_64-darwin12.2.0]
[2013-04-03 11:53:46] INFO WEBrick::HTTPServer#start: pid=13848 port=3000
I, [2013-04-03T11:53:50.521162 #13848] INFO -- : Started GET "/" for 127.0.0.1 at 2013-04-03 11:53:50 +0100
F, [2013-04-03T11:53:50.695426 #13848] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/"):
actionpack (4.0.0.beta1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.0.beta1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0.beta1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0.beta1) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0.beta1) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0.beta1) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0.beta1) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0.beta1) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0.beta1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0.beta1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
actionpack (4.0.0.beta1) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0.beta1) lib/rails/engine.rb:510:in `call'
railties (4.0.0.beta1) lib/rails/application.rb:96:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/Users/jbatista/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/jbatista/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/jbatista/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
网页错误: