views:

64

answers:

3

I'm on Ubuntu. I type in sudo gem install rails. This works fine, installs railes and 7 other gems fine. Yet $ rails blog is saying this:

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

Make sure your gem executable path is added to your system path so that the system can find the rails executable.

Daniel Vandersluis
You can do this by typing `echo $PATH` at the command line and checking that it contains the "EXECUTABLE DIRECTORY" that is printed when you type `gem environment`
Ceilingfish
A: 

Type

gem env

It will give you the installable directory where the bins of the gems are being installed. Something like this:

EXECUTABLE DIRECTORY: /usr/bin

Make sure this directory is in your path.

robertokl
+1  A: 

how did you install rubygems, as an admin, or as a user? if you installed it as a user, it may not have the bin directory in your path.

If I were you, (assuming you installed rubygems into your home folder), I would trash that installation dir (not sure where it defaults to, maybe ~/rubygems? or ~/.rubygems?), then run setup.rb from the rubygems tarball as admin (through sudo) I've done this at least a dozen times on ubuntu, and haven't run into the issue you are hitting.

If that isn't the case, could you please link to the blog post you were following?

Matt Briggs
I tried that way (running setup.rb) and it won't install rdoc correctly.... the README said it came with it auto installed, but no. Then I installed manually and it complains that the rdoc generator fails. How can I uninstall it now...?
Zombies
this is part of the whole "debian does a terrible job with ruby" thing. if you did 'apt-get install ruby' you also need to do it for rdoc. if you installed ruby on any other platform any other way, its included in the box. rdoc is one of those optional things though, if you don't have it, it just means you wont have local documentation and will have to use the online ruby docs (i use it anyways, just used to it)
Matt Briggs
i am seeing problems with debian yes..... what should i do? use package manager or install everything from source?
Zombies
rubygems should be the only thing you need to install from source, once you have that, you can install rails (and other ruby libraries) through gem. The other problem is learning what packages you need to get a full ruby install, but once you have that figured out you shouldn't have any more issues.
Matt Briggs