2010-08-09

Installation of Ruby, Rails & Co. on Ubuntu

reqs: Ubuntu
tested version: 10.04

target: development environment with ruby 1.9.2-rc2 and rails3-rc1

Installation of a Ruby on Rails development environment has become way easier under Linux nowadays. There is this fantastic gem "rvm", which actually does nearly all the stuff necessary for a clean rails development environment.

Ok first thing to do after the installation of Ubuntu: open the terminal console, and using 'sudo'

we install some background software, which the system will need to do the actual installations.
apt-get -y install build-essential zlib1g-dev libssl-dev gzip zip unzip libzip1 libzip-dev git-core subversion curl bison vim libreadline5 openssl libreadline5-dev libxml2-dev libxslt-dev autoconf sqlite3 libsqlite3-dev sqliteman
Incase the following packages are not yet installed and if you want/need them (you might) try
apt-get -y install postgresql-8.4 libpq-dev pgadmin3 imagemagick mercurial tortoisehg tortoisehg-nautilus sun-java-jre6 openssh-server yakuake
Then type
exit
to leave the sudo mode and with your normal user account install rvm (you might want to re-check http://rvm.beginrescueend.com/rvm/install/ as they might change the install script every now and then)
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

At the end of the rvm installation you will get some explanations to modify your .bashrc. Follow these instructions (usually there shouldn't be any 'return' line (and if its a comment line)  in a fresh ubuntu install) and then type
echo "source \"\$HOME/.rvm/scripts/rvm\"" >> .bashrc
to add environment-loader to the end of your .bashrc file, as that line is crucial for running rvm.

Type
rvm reload
to reload the rvm environment and exit the terminal console.

Start a new terminal console.

After that is done you just
rvm install 1.9.2
which will load, compile and install ruby 1.9.2 from its source.

Then we have to tell our system, that we want to use 1.9.2 as default ruby
rvm 1.9.2 --default
and are ready to install rails3 (rc1 still is a pre-release so don't forget --pre)
gem install rails --pre
and there you go.

Nice and easy install of (as of now, might change soon again when ruby 1.9.2 or rails 3 go stable) Ruby 1.9.2rc2, rails 3 rc1.

Have fun developing your Ruby on Rails applications.

1 comment:

  1. i tested it at home, it is great :) see you tomorrow

    Benny

    ReplyDelete