I just went through the process of setting up a new Linux desktop for Rails development. In an effort to keep it short and to the point, I’ve trimmed up some of the info that I found useful from wiki.rubyonrails.org. This is just a basic development stack. I plan to write another post on the editors that I’ve tried and what I’ve found to work best for me so far. Anyway, let’s get started. I tend to work primarily at a command prompt, so that’s the method I’ve described here. Open a terminal window and follow along:
sudo apt-get install ruby rdoc libyaml-ruby libzlib-ruby ri libopenssl-ruby ruby1.8-dev build-essential
You don’t want to install the rubygems package from the Ubuntu repository. It is consistently out of date, so you will need to pull the tarball down from RubyForge:
wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
tar xvzf rubygems-1.2.0.tgz
cd rubygems-1.2.0
sudo ruby setup.rb
At least with the versions I’ve installed, I had to create a symbolic link to gem1.8:
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
You should now be able to do a gem update:
sudo gem update --system
And install Rails:
sudo gem install rails
Now it’s time to take care of the database installation:
sudo apt-get install mysql-server libsqlite3-0 libsqlite3-dev sudo gem install mysql sqlite3-ruby
If you want to install RMagick:
sudo apt-get install imagemagick libmagick9-dev sudo gem install rmagick
That should do it. Now go have some fun!