我不能让瑞克在我的机器上工作。这只发生在从Rubygems安装的Rake版本(不是Debian安装的版本)。请参阅上面的内容:
charlotte:~# which rake
/var/lib/gems/1.8/bin//rake
charlotte:~# rake
/var/lib/gems/1.8/bin/rake:17: undefined method `require_gem' for main:Object (NoMethodError)
charlotte:~# rake -v
/var/lib/gems/1.8/bin/rake:17: undefined method `require_gem' for main:Object (NoMethodError)
charlotte:~# gem -v
1.6.2
charlotte:~# ruby --version
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
charlotte:~# gem list | grep rake
rake (0.8.7)
charlotte:~# /usr/bin/rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2377:in `raw_load_rakefile'
(See full trace by running task with --trace)
charlotte:~# 发布于 2011-03-16 23:24:06
我不认为你有一个最新版本的rake。第17行的Rake曾经有过require_gem,但在过去几年的所有版本中都被gem所取代。找出$GEM_HOME指向的地方,也可以卸载您的发行版Rake。如果你的GEM_HOME是不同的东西(它可能是空的,这是正常的),从你的路径中删除到坏掉的rake的路径,并在那里删除那些gem。
还可以尝试在shell中运行gem environment。总而言之,你在这条路径上拥有的rake版本不是0.8.7,它更老了,我不认为rubygems会把你的宝石放在那里。
https://stackoverflow.com/questions/5327225
复制相似问题