running rake fails with Gem::GemNotFoundException ERR

2.9k views Asked by At

Backstory:

New to rails and attempting to install Passenger on a Mediatemple DV server. I am following and somewhat modifying this CentOS guide here since MT currently does not have any recommended 'how tos' regarding setting up a Rails production environment http://www.freshblurbs.com/installing-ruby-rails-3-centos-nginx.

I have fresh-ly installed gem and then ran gem install rake as root. Now, anytime I try to run

rake some_task

I get the following error

/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:370:in `bin_path': 
can't find gem rake ([">= 0"]) with executable rake (Gem::GemNotFoundException)
from /usr/local/bin/rake:19:in `<main>'

rake is installed here /usr/local/bin/rake

$PATH is /usr/kerberos/sbin:/usr/kerberos/bin://sbin://bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/bin:/usr/local/bin:/root/bin:/usr/bin:/usr/local/lib

output of gem which rake is /usr/local/lib/ruby/1.9.1/rake.rb

... and unfortunately that's about all I got up my sleeves. What am I missing that's causing this to bomb?

Thanks in advance!

2

There are 2 answers

0
Mike On BEST ANSWER

I have the similar problem with rake, but in ruby 1.9.2.

http://betterlogic.com/roger/2010/11/ruby-1-9-2-rake-woe/ Maybe in your case it will be helpful too.

2
2potatocakes On

Not sure this'll help maybe it will.. maybe not..

But run a gem list first and make sure both rake and also the passenger gem show up. I think I remember seeing a similar error that was misleading trying to setup a production server recently when running:

passenger-install-apache2-module

face palmed when I realised i hadn't installed the passenger gem yet