1

I have installed ruby 1.9.3 in my Ubuntu 12.04 machine following the instructions in https://github.com/postmodern/ruby-install and executing the following command:

sudo ruby-install ruby 1.9.3

I was assuming this would link from my /usr/bin or somewhere else visible from my path ruby or gem, but it doesn't. When I try for example: gem install bundler, I get:

sudo: gem: command not found

It also can't find ruby when I try ruby -v.

If I install with sudo apt-get install ruby1.9.3, I'm able to execute both ruby and gem:

$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ gem -v
1.8.11

I was expecting from ruby-install the same output I got from apt-get. Am I looking in the wrong place? How do I run ruby and gem after installing with ruby-install?

I know there are other installers for ruby like rvm and rbenv, but I'm following some installations instructions and they clearly instruct to use ruby-install.

Thanks in advance!

zapatilla
  • 1,711
  • 3
  • 22
  • 38
  • read this ... There are two ways for installing ruby .1) using rbenv 2) using rvm ,.... read here . https://gorails.com/setup/ubuntu/14.04#ruby – z atef Sep 07 '15 at 18:43
  • Thanks for your comment, @NullSoulException. I've updated my questions, since although there are other ruby installers, I'm following some instruction manual for an application and it clearly instructs to use ruby-install. – zapatilla Sep 08 '15 at 09:10

1 Answers1

1

OK, found the answer.

After running

sudo ruby-install ruby 1.9.3

the last line from the log is:

>>> Successfully installed ruby 1.9.3-p547 into /opt/rubies/ruby-1.9.3-p547

Which I have no excuse for not paying attention to since it's in bold colourfull letters.

Erm, anyway, adding /opt/rubies/ruby-1.9.3-p547 to the PATH makes ruby and gem work.

export PATH=$PATH:/opt/rubies/ruby-1.9.3-p547/bin
zapatilla
  • 1,711
  • 3
  • 22
  • 38