I’m having issues getting Rake to work on my machine. This only happens from the Rake version that was installed from Rubygems (not the Debian installed one). Please see above:
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:~#
I do not think you have a recent version of rake there. Rake on line 17 used to have
require_gemand that has been replaced with justgemin all versions from the last few years. Find out where $GEM_HOME is pointing, and also apt uninstall your distribution version of Rake. If your GEM_HOME is something different(it may be empty which is OK), remove the path to the broken rake from your PATH and remove those gems there.Also try running
gem environmentin your shell. In summation, the version of rake that you have in that path is not 0.8.7 it is older, and I do not think rubygems is putting your gems there.