Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed ruby1.8 and ruby1.8-dev packages but it doesnt respond to the ruby command at the command line.

ruby
The program 'ruby' is currently not installed.  You can install it by typing:
sudo apt-get install ruby
irb
The program 'irb' is currently not installed.  You can install it by typing:
sudo apt-get install ruby

I am just a little concernted that installing ruby will install a different version.

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

I can only recommend removing the repository rubies and install it via RVM (Ruby Version Manager AFAIK). This will also allow you to have several versions installed, should you ever need that.

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo "[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session." >> .bashrc

Then RVM should be installed. Close current terminal and reopen, in order to reload the bash profile. Ruby can now easily be installed by typing

rvm install 1.9.2  #Replace with whatever version you'd like (1.8.7, ree etc.)
rvm --default 1.9.2

This will also install rubygems, and the alias commands for you.

Since none of these commands should be sudo'ed, you will not experience permission problems with gems later on either :-)

Edit: To answer the last question, installing "ruby" from apt will install ruby1.8 too. It's even the same version, but with links fixed. You could just do a

sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby

to fix the links :-)

share|improve this answer
    
I will do this if I want to install another ruby version. –  justintime Sep 5 '11 at 19:56
add comment
irb

to start the i nteractive r uby b rominisculantiouszorpf (interactive ruby brompt?)

share|improve this answer
add comment

Start ruby1.8.

The Ruby version that will installed by the package ruby depends on your Ubuntu version. In 11.04 it's Ruby 1.8. You can find it out using

 apt-cache show ruby| grep ^Depends
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.