Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sudo gem install rails- this doesn't give me a rails command for bash

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
like image 212
Zombies Avatar asked Dec 27 '25 16:12

Zombies


2 Answers

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.

like image 80
robertokl Avatar answered Dec 30 '25 04:12

robertokl


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?

like image 41
Matt Briggs Avatar answered Dec 30 '25 05:12

Matt Briggs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!