I recently installed Ubuntu Jaunty Jackalope and hadn’t yet got around to putting Rails on to it.
Installing Ruby and Gems and Rails and getting them all to work nicely together can be a pain, so i’m happy to say i managed to go from nothing to Rails installed and working in 14 minutes this time! Thanks very much to Installing Ruby on Rails on Debian/Ubuntu for most of the tips. Here’s how it panned out for me:
sudo apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz tar xzf stable-snapshot.tar.gz cd ruby/ ./configure make
sudo make install
A quick test:
ruby -v ruby 1.8.8dev (2009-06-11) [x86_64-linux]
ruby -ropenssl -rzlib -rreadline -e "puts :Hello" Hello
Good. Ruby installed and working with openssl, zlib and readline. So far so good. Now for the gems.
Check on RubyForge for the latest version of gems to download.
cd .. wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz tar xzvf rubygems-1.3.4.tgz cd rubygems-1.3.4/ sudo ruby setup.rb
gem -v 1.3.4
Lovely. Now i can install Rails.
sudo gem install rails
Bah, i should have chosen
rails -v Rails 2.3.2
gem list *** LOCAL GEMS *** actionmailer (2.3.2) actionpack (2.3.2) activerecord (2.3.2) activeresource (2.3.2) activesupport (2.3.2) rails (2.3.2) rake (0.8.7)
So i have Rails in 14 minutes. That made a good post title, but it’s not over yet! I’m going to need MySQL.
sudo apt-get install mysql-server mysql-client
sudo apt-get install libmysql-ruby sudo apt-get install libmysqlclient15-dev sudo gem install mysql
I always like to use PhpMyAdmin with MySQL.
sudo apt-get install phpmyadmin
A line needs to go at the bottom of
sudo /etc/init.d/apache2 restart
Yay! Installed and working!
A quick test of a Rails application …
sudo gem install mongrel
Whew! Better! :)
Lovely ugly Rails scaffolding! Perhaps this is a good time to try out Hobo. That’ll be my next blog post! :)