在不同的环境中启动Rails 3.1

25

试图在本地以生产模式启动Rails 3.1应用程序。

rails s

将会很好地启动开发。 当我尝试

rails s production

我遇到了这个错误:

/usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/handler.rb:63:in
  `require': no such file to load -- rack/handler/production (LoadError)
      from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/handler.rb:63:in `try_require'
1个回答

69

显然正确的命令是

rails s -e production

如果我错了,请纠正我,但我相信以前不需要“-e”。


当我这样做时,我得到其他错误,例如“堆栈级别太深”。那个-e是什么?我猜不是“忽略错误”? - Niklas Winde
"Stack level too deep" 可能意味着您有一个永远不会返回的递归函数。 "-e" 用于 "环境"。 - tybro0103

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接