'rails server -e development'在Ubuntu上失败了

时间:2011-05-14 17:57:59

标签: ruby-on-rails ubuntu

我按照说明here尝试在本地安装Teambox。在说明中,将在CLI中键入以下命令:

rails server -e development

但是当我发出该命令时,我收到以下响应:

root@localhost:/home/oompah/webstuff/teambox# rails server -e development
getopt: invalid option -- 'e'
Terminating...

我删除了e选项,命令似乎只是(重新)生成服务器端文件 - 并提示我是否要覆盖现有文件。

毋庸置疑,正如文档所示,http://localhost:3000上没有Teambox可用 - 很可能是因为上面突出显示的上述错误。

BTW,我在Ubuntu 10.0.4 LTS上运行。

有没有人对此有解释?文档是错误的(过时的),还是我做错了什么?

[编辑]

我忘了添加:

root@localhost:/home/oompah/webstuff/teambox# rails --version
getopt: unrecognised option '--version'
Terminating...

这很烦人,因为我甚至无法找出它是哪个版本。顺便说一下,我使用:

安装了rails
apt-get install rails

[EDIT2]

root@localhost:/home/oompah/teambox# gem query | grep rails
Error loading RubyGems plugin "/usr/lib/ruby/gems/1.8/gems/yard-0.6.4/lib/rubygems_plugin.rb": undefined method `overwrite_accessor' for Gem::Specification:Class (NoMethodError)
cucumber-rails (0.3.2)
rails (3.0.3)
rspec-rails (2.3.1)
sprockets-rails (0.0.1)

2 个答案:

答案 0 :(得分:2)

问题在于来自Teambox网站的简洁(太简洁?)doco。他们列出的命令将运行库存rails二进制文件,而不是 <teambox install dir>/script/目录中的那个。

e.g。

$which rails
/usr/bin/rails.

这不是你想要的。

将您的命令更改为:

cd <teambox install dir>

script/rails server -e development.

这将在你的teambox安装的脚本子目录中运行他们的自定义rails二进制文件,而不是路径上的stock rails二进制文件:)。

答案 1 :(得分:0)

试试这个:

rails server --environment development