conbask
conbask

Reputation: 10061

The program 'rails' is currently not installed?

I've installed Ruby (1.8.7 via apt-get) and I installed Rails (2.3.2 via rubygems) but when I type 'rails newapp', I get this error:

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

When I run 'gem list' it shows rails and all of it's dependencies. Any idea what might have gone wrong?

Upvotes: 2

Views: 6506

Answers (6)

Pilo
Pilo

Reputation: 1250

You can also try running your terminal as 'login shell'. That worked for me.

Upvotes: 0

parzival
parzival

Reputation: 1626

Nick's answer works for me under Ubuntu 10.10 (thanks, I was desperate).

sudo apt-get remove rubygems wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz tar xzvf rubygems-1.3.7.tgz cd rubygems-1.3.7/ sudo ruby setup.rb sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

Upvotes: 3

Luca Brivio
Luca Brivio

Reputation: 41

rubygems' binary directories are not automatically included in the PATH. Also, you may try asking any Debian-related questions on Debian Q&A.

Upvotes: 4

nictrix
nictrix

Reputation: 1483

How did you install rubygems? I've found problems when using it through the ubuntu repositories in the past. Usually I remove that package and compile and install

sudo apt-get remove rubygems
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
tar xzvf rubygems-1.3.7.tgz
cd rubygems-1.3.7/
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

or you may just have to symbolic link it:

sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

Upvotes: 2

Mark Thomas
Mark Thomas

Reputation: 37507

Using debian ruby packages is going to be misery, for more reasons than just the path issue you currently have. I recommend using rvm instead. rvm allows you to easily install new versions of ruby or even bounce back and forth between multiple installed versions (even jruby) and it will always fix your path appropriately so everything you need is in your path.

  1. Remove all debian ruby packages
  2. Install and configure rvm
  3. rvm install ruby-1.8.7

Upvotes: 3

Jeremy
Jeremy

Reputation: 22415

Do you have multiple version of ruby or rubygems installed?

Type which ruby and which gem to confirm that you are using the correct binaries.

Upvotes: 2

Related Questions