繁体   English   中英

Rails服务器将不接受命令行参数

[英]Rails server won't take command-line arguments

我正在尝试在Debian 7.3(Ruby 1.9.3p194,Rails 2.3.14)上运行Ruby / Rails教程,但似乎无法使服务器以任何命令行参数开头。 作为root,我在/ root中使用以下命令创建了Rails骨架目录:

# rails -d postgresql demo/inventory

我可以通过执行脚本/服务器在默认端口3000上启动服务器,但是给出命令行参数的任意组合(例如-d用于守护程序模式,-p 80在端口80上运行)会产生错误:

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- rack/handler/-p (LoadError)

要么

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- rack/handler/-d (LoadError)

任何命令行参数都将被同样对待。 最后的致命错误之前是一堆警告(即使我在不​​带参数的情况下在端口3000上成功启动了服务器):

NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /root/demo/inventory/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /root/demo/inventory/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.

最后的警告重复了几次。 我感觉到我缺少一些包装或宝石,但是我不知道从哪里开始。

首先,有点偏离主题,如果您要启动一个新的Rails项目,则可能应该使用更高版本的ruby和rails。

rails server -p 4567是启动服务器时要查找的命令。 我猜您正在传递标志,而没有表明您希望Rails启动服务器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM