Native Ruby 1.9 + Rails 3 in Ubuntu

posted in: HOWTO | 2

Install the Ruby 1.9.1 (which is actually 1.9.3, presently) package:

aaron@naegleria:~$ sudo apt-get install ruby1.9.1-dev

You will also need to remove all packages that use Ruby 1.8.x. The easiest way to do this is to just use synaptic, search for “ruby”, sort by “installed” (the far left column), and “Mark for Removal” on each package that mentions ruby1.8. There should be about 3, possibly more.

Once that’s done, check in the terminal:

aaron@naegleria:~$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
aaron@naegleria:~$

As long as you see “1.9.x” or better, you should be fine.

Now install Rails 3:

aaron@naegleria:~$ sudo gem install rails

This will take a while. You’ll see lots of stuff fly by. When you’re done, confirm:

aaron@naegleria:~$ rails -v
Rails 3.2.8
aaron@naegleria:~$

That’s it! Note that future gems will need to be sudo installed, if you aren’t using Bundler. Running bundle will prompt you for your sudo password.

2 Responses

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.