在安装 Foreman 之前,我已成功安装并使用了所有东西(node.js、npm、express)。我首先安装 Ruby,然后安装 Foreman:
alex@ubuntu:~$ sudo apt-get install ruby1.9.1
然后安装 Foreman。我是 Unix 新手,因此在这里可能没有必要“sudo”,但我在终端中确认已安装,但也有一些错误:
alex@ubuntu:~/NodeHelloWorld$ sudo gem install foreman
Invalid gemspec in [/var/lib/gems/1.8/specifications/foreman-0.26.1.gemspec]: invalid date format in specification: "2011-11-10 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/foreman-0.26.1.gemspec]: invalid date format in specification: "2011-11-10 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z"
Successfully installed term-ansicolor-1.0.7
Successfully installed foreman-0.26.1
然后,当我尝试启动 foreman 时,我得到类似的结果:
alex@ubuntu:~/NodeHelloWorld$ foreman start
Invalid gemspec in [/var/lib/gems/1.8/specifications/foreman-0.26.1.gemspec]: invalid date format in specification: "2011-11-10 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z"
/usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:926:in `report_activate_error': Could not find RubyGem foreman (>= 0) (Gem::LoadError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:244:in `activate_dep'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:236:in `activate'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1307:in `gem'
from /usr/local/bin/foreman:18
有人能帮我吗?我是 Unix 新手,最终放弃了 Windows,因为我发现我无法获得工头窗户为我工作
我找到了一个似乎有同样问题的人的这篇文章。这是否意味着我的 ruby 版本可能不对?我正在运行 1.9.1,但我也是 ruby 新手;
alex@ubuntu:~/NodeHelloWorld$ ruby1.9.1 -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
谢谢
答案1
我找到了一个解决方案——通过打开管理员“会话”来编辑 gemspec 文件:
Alt+F2然后输入gksudo nautilus
并浏览、编辑和保存.gemspec 文件。
两个问题文件都需要编辑日期从2011-11-10 00:00:00.000000000Z
到2011-11-10