eksatx
eksatx

Reputation: 1023

rake: command not found

I'm trying to install rails on Ubuntu 9.10.

gem list --local

*** LOCAL GEMS ***

actionmailer (2.3.4, 2.3.2)
actionpack (2.3.4, 2.3.2)
activerecord (2.3.4, 2.3.2)
activeresource (2.3.4, 2.3.2)
activesupport (2.3.4, 2.3.2)
rack (1.0.1)
rails (2.3.4, 2.3.2)
rake (0.8.7)
sqlite3-ruby (1.2.5)

rake
The program 'rake' is currently not installed.  You can install it by typing:
sudo apt-get install rake
rake: command not found

How do I solve this?

Upvotes: 28

Views: 54001

Answers (5)

lucapette
lucapette

Reputation: 20724

The solution, at least for me, is making the symbolic link.

This is the kind of issue I have to remember. Every time I set a new Ubuntu machine I run into this little problem.

Upvotes: 1

sumpfgottheit
sumpfgottheit

Reputation: 145

I ran into the same problem on Centos 5.5 and self compiled ruby and rails. (Need it for redmine) When i tried to install passenger using passenger-install-apache2-module, I did an strace and round out, that passenger looks for rake in the ruby/bin directory and not the gems/bin directory, where rake was installed. So a

ln -s /usr/local/ruby1.8.7/lib/ruby/gems/1.8/bin/rake /usr/local/ruby1.8.7/bin

solved it for me. (/usr/local/ruby1.8.7 is where i installed ruby...)

Upvotes: 0

anotherdjohnson
anotherdjohnson

Reputation: 303

They are correct, you need to have rake in your path. However if you want to make sure it's just there, instead of exporting it from .bashrc, make a symbolic link:

sudo ln -s /var/lib/gems/1.8/bin/rake /usr/bin/rake

If you do that, you should always be able to use it.

Upvotes: 1

Henryk Konsek
Henryk Konsek

Reputation: 9168

Gem is complaining about the rake program (i.e. executable), not the rake gem (you have the latter already installed).

That means that you have to add rake exec to the PATH. Possible rake bin location is /var/lib/gems/1.8/bin/rake. Add it to your PATH then:

export PATH=${PATH}:/var/lib/gems/1.8/bin

You can also install Rake from the Ubuntu repository (as suggested in the gem output):

sudo apt-get install rake

Upvotes: 9

Siddhartha Reddy
Siddhartha Reddy

Reputation: 6211

You need to add /var/lib/gems/1.8/bin to your PATH. Try this command:

export PATH=$PATH:$HOME/bin:/var/lib/gems/1.8/bin

After that rake should work.

You can add this line to your ~/.bashrc so that you don't have to type in this command each time.

Upvotes: 45

Related Questions