Ruby on RailsSo it’s finally time to learn Ruby on Rails. As a software arch I’ve always made it a point to be able to work with all of the tools and technology in the company we could consider using. That hasn’t always been fun, some technologies are more painful to work with than others, but I won’t name names. And now it’s time to learn RoR.

I figured I may as well keep a blog journal of how it goes in case it’s helpful to anybody else. Like there’s not enough material out there already! :)

This starts with a working base copy of Ubuntu desktop 7.04. After all if you’re going to be acting like a Roman it may as well be in Rome. The following gets a base install up to it’s fighting weight.

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install build-essential

I used the System -> Administration -> Synaptic Package Manager to check on the versions of certain package. Ruby is 1.8.5, Rails is 1.2.1, and RubyGems is 0.9.0… Looks like Ruby is okay, but Gems is up to 0.9.4 and Rails is up to 1.2.3… I think I’ll install the ruby package, build gems from source, and install rails from gems. Hey! A perfect example of this approach. I’ll repeat the commands I used here, but see that resource for more details.
Note: if you’re going follow this be sure to go look for the current gems path which isn’t really shown below.

#install ruby
sudo apt-get install ruby ri irb
#install rubygems
mkdir ~/src
cd ~/src
wget http://rubyforge.org/.../rubygems-0.9.4.tgz
tar -zxvf rubygems-0.9.4.tgz
cd rubygems-0.9.4
sudo ruby setup.rb
#install rails
sudo gem update
sudo gem install -y rails
#test rails
mkdir ~/sites
rails ~/sites/railstest
cd ~/sites/railstest
./script/server

And there you go! Firefox at localhost:3000 just gave me the “Welcome aboard” for the following

Ruby version 1.8.5 (i486-linux)
RubyGems version 0.9.4
Rails version 1.2.3
Active Record version 1.15.3
Action Pack version 1.13.3
Action Web Service version 1.2.3
Action Mailer version 1.3.3
Active Support version 1.4.2
Application root /home/loudej/Sites/railstest
Environment development
Database adapter mysql

Update: just added a “sudo” to the “get update” command. Also changed “~/Sites” to “~/sites”. When in Rome after all.