Tag Archives: Ruby


I’ve been trying for some time to get into the Rails development but it’s been hard. Now I found Redmine, a very nice web tool for project management written in RoR, that might help me understand a little more about this framework.

First of all, my team at work moved from Trac 0.12 to Redmine 2.0.3. It was kinda hard to migrate the database but we did it. I needed to make a lot of changes in the migration script but we managed to move after all. I learned some small things about Rails, but nothing relevant.

After this event I decided to run my own instance of Redmine in one of my machines to manage at least one of my personal projects. Very few things have been done yet and I’m not sure where I’ll run it: in Heroku or Amazon EC2. I know Heroku has only 5MB of storage but it might save a day or two that I would need to spend installing MySQL+Apache+Passenger from scratch in a EC2 Micro instance.

Well, I’ll decide about that later. I hope this will keep me busy with Rails stuff and maybe inspire me to make or write something useful for you guys.

How to install Ruby on Rails on Linux

This might be the fourth time I have to install RoR in one of my machines and I struggle every time I have to. This post is to make me “not forget” how to install Ruby on Rails on Linux that doesn’t have the latest version of Rails packaged. The following steps have been executed on a 64-bit Debian Lenny machine.

So, the first step is to get the Ruby source code, compile and install. Easy “configure+make+makeinstall” task, starting from its website. The version I downloaded was 1.9.2-p180.

$ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz 
$ tar -xzf ruby-1.9.2-p180.tar.gz 
$ cd ruby-1.9.2-p180 
$ RUBYDIR="/opt/ruby-1.9.2" 
$ ./configure --prefix="${RUBYDIR}" 

Ah! There is one additional step: you might also add some modules to the compilation, like “readline” and/or “openssl” (Heroku needs it) and for that you need to uncomment those lines in the “ext/Setup” file. After editing (or not) you can continue with:

$ make 
$ sudo install -d -o `id -u` "${RUBYDIR}" 
$ make install 

Set your PATH to include the Ruby binary directory (you might also set it in the “/etc/profile” file):

$ PATH="${RUBYDIR}/bin:${PATH}"

Some applications ask for specific modules like “readline” (Heroku needs it). For that you need to install it calling:

$ cd ext/readline 
$ ruby extconf.rb 

If you don’t see “creating Makefile” at the end of the log messages, the building won’t work. Install the needed packages (with “apt-get install libreadline5-dev”, for example) and re-run it. After that just “make+makeinstall”:

$ make 
$ make install 

Now let’s install Rails:

$ gem install rails 

You might also want to install some additional packages too, like “jquery-rails” and “heroku”:

$ gem install jquery-rails heroku 

Finally, fix the Ruby directory permissions:

# sudo chown -R root:root "${RUBYDIR}"