0

I have gone through a lot of blogs and tutorials (including Beginning Rails 3) and now I have a messed up Ubuntu (It runs on VMWare) that I do not like it.

Main problem is that based on Beginning Rails 3 I have installed Ruby 1.9.1 but Rails 3 insists that it needs Ruby 1.9.2 to run ... and I have failed till this moment to handle that. RVM installation failed too (some where in the process, the progress percentage freezes on 17%).

I am a windows guy and a .NET developer (nuts if you prefer). But this amount of time for just getting started is a nightmare!

And since I do not know how to clean up Ubuntu I think I should install a new Ubuntu!

Thanks!

1

3 Answers 3

0

sudo apt-get install ruby1.9.1 installs 1.9.2 on Debian. Weird? It's because 1.9.1 is ABI version; the package version field correctly states that it is 1.9.2.

6
  • Thanks but it says: sudo: aptitude: command not found. Commented Dec 1, 2010 at 11:56
  • Sorry, I've completely forgot about the last modification in Ubuntu which removes aptitude from default install; you should use apt-get instead. Commented Dec 1, 2010 at 12:01
  • Thanks; I have done that but ruby -v gives me ruby 1.9.1p376... but which ruby returns the correct path /usr/local/bin/ruby. Did I forget something? Commented Dec 1, 2010 at 12:52
  • if you installed ruby via apt-get, it definetly doesnt install itself into /usr/local .. you propably have installed ruby to /usr/local by some other means and your $PATH has /usr/local/bin before /usr/bin. Try: "/usr/bin/ruby -v" and "/usr/local/bin/ruby -v" and check the versions.. Commented Dec 1, 2010 at 21:22
  • Thanks; /usr/bin/ruby -v gives me 1.8.7 and /usr/local/bin/ruby -v gives 1.9.1p378 - I thought apt-get would overwrite /usr/local/bin/ruby, shouldn't it? Commented Dec 1, 2010 at 22:18
1

The solution to getting ruby 1.9.2 installed is to use RVM. RVM, the ruby version manager, makes it very easy to install and use the latest version of Ruby. I've written a short tutorial on getting it up and running: http://blog.dcxn.com/2011/06/20/setting-up-rvm-on-ubuntu-11-04/

After you're up and running you tell RVM to always use 1.9.2:

rvm --default use 1.9.2 

after getting ruby installed through rvm. It's pretty simple to get rails going by installing the gem:

gem install rails 
-3

Best way to have multiple ruby version is to use rvm. after installing rvm you can install multiple ruby version simply by

rvm install 1.8.7 rvm install 1.9.2 rvm install jruby 

switching is even more easy, type (in terminal)

rvm use 1.8.7 --default #to use rvm for this terminal session and also sets ruby 1.8.7 as default ruby version ruby -v #should give ruby version set for current session ruby use 1.9.2 #sets different ruby to be used for this session 

for complete installation instruction see here

2
  • 1
    Please don't always post the exact same answer to all questions. This one already had an answer suggesting using RVM (as well as several others to which you've posted this very same text). Commented Aug 8, 2011 at 13:49
  • 1
    @slhck has concisely made the point already, but I thought I'd just step up and strengthen this warning a little. Copy-paste answers are generally not welcome here, you can provide the same details in more than one answer across the site, but tailor each answer them to the question posed, and don't obviously duplicate previous older answers on the questions you are tackling. Commented Aug 8, 2011 at 14:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.