在使用 RVM Ruby 1.9.3-p194 将一个非常基本的 Rails 3.2.3 试用站点部署到“生产”服务器(不是真正投入生产,谢天谢地!)后,我发现以下列出的命令是正确的:
╔══════════════════════════════════════╤═══╗
║ command issued │OK?║
╟──────────────────────────────────────┼───╢
║ bundle exec rails console │ N ║
║ bundle exec rails console production │ Y ║
║ bundle exec rails server │ Y ║
║ bundle exec rails server production │ N ║
╚══════════════════════════════════════╧═══╝
我的第一个问题:这是预期的吗?(我原以为右栏中的模式应该是 NYNY。)
更多信息:由于服务器上未安装sqlite3bundle exec rails console
gem的可理解原因而失败。但是,失败的痕迹更难理解:bundle exec rails server production
$ bundle exec rails server production
Exiting
/home/spkspike/www/spike.sampablokuper.com/releases/20120530134819/vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler.rb:63:in `require': cannot load such file -- rack/handler/production (LoadError)
from /home/spkspike/www/spike.sampablokuper.com/releases/20120530134819/vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler.rb:63:in `try_require'
from /home/spkspike/www/spike.sampablokuper.com/releases/20120530134819/vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler.rb:16:in `get'
from /home/spkspike/www/spike.sampablokuper.com/releases/20120530134819/vendor/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:269:in `server'
from /home/spkspike/www/spike.sampablokuper.com/releases/20120530134819/vendor/ruby/1.9.1/gems/railties-3.2.3/lib/rails/commands/server.rb:59:in `start'
from /home/spkspike/www/spike.sampablokuper.com/releases/20120530134819/vendor/ruby/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:55:in `block in <top (required)>'
from /home/spkspike/www/spike.sampablokuper.com/releases/20120530134819/vendor/ruby/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
from /home/spkspike/www/spike.sampablokuper.com/releases/20120530134819/vendor/ruby/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
我的第二个问题:如何最好地解决这个错误?