Why can't Ruby find Rake?
It looks like rake is trying to run from /usr/bin/rake
, the system version of Ruby, while you have a custom install of Ruby in /usr/local
.
- Make sure you have the rake gem installed for the Ruby installation you're using
- Make sure the
rake
command is in a directory on your $PATH.
which gem
should return the rubygems install from /usr/local/bin
. If not, that's the first problem to solve. Then you want to make sure you have the rake gem in your /usr/local
Ruby installation:
gem list | grep rake
should tell you if the gem is installed. If not, run gem install rake
.
At this point, which rake
should point to something in your /usr/local
path. If it doesn't use find /usr/local | grep rake
to figure out where your Ruby install is keeping gem executables and add that directory to your loadpath.
As a side note, if you're using your own install of Ruby, you might find rvm or rbenv helpful for managing installs and gems.
jayfallon
Updated on July 18, 2022Comments
-
jayfallon over 1 year
I was using the Rails 3 beta gem yesterday but went back to 2.3.8, and, after cleaning the system gems, I was trying to run a simple Rake task and got this:
Peleliu:haml jayfallon$ sudo rake install /Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem rake (>= 0) (Gem::LoadError) from /Library/Ruby/Site/1.8/rubygems.rb:214:in `activate' from /Library/Ruby/Site/1.8/rubygems.rb:1082:in `gem' from /usr/bin/rake:18
I am not sure if it has to do with my path being borked or not.
RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/local/bin/ruby - EXECUTABLE DIRECTORY: /usr/local/bin - RUBYGEMS PLATFORMS: - ruby - x86-darwin-10 - GEM PATHS: - /usr/local/lib/ruby/gems/1.8 - /Users/jayfallon/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - :sources => ["http://gems.rubyforge.org/", "http://gems.github.com", "http://gems.github.com", "http://gems.github.com", "http://gems.github.com", "http://gems.github.com", "http://gems.github.com", "http://gems.github.com", "http://gems.github.com", "http://gems.github.com", "http://gemcutter.org/"] - REMOTE SOURCES: - http://gemcutter.org/