Rails on Ubuntu in 14 minutes
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:
21:33
sudo apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev
21:34
wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz tar xzf stable-snapshot.tar.gz cd ruby/ ./configure make
21:37
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.
21:39
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
21:42
gem -v
1.3.4Lovely. Now i can install Rails.
21:43
sudo gem install rails
Bah, i should have chosen --no-rdoc --no-ri!
21:47
rails -v
Rails 2.3.2Success!
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.
21:48
sudo apt-get install mysql-server mysql-client
21:49
sudo apt-get install libmysql-ruby sudo apt-get install libmysqlclient15-dev sudo gem install mysql
I always like to use PhpMyAdmin with MySQL.
21:51
sudo apt-get install phpmyadmin
21:54
A line needs to go at the bottom of /etc/apache2/apache2.conf:
Include /etc/phpmyadmin/apache.conf
21:55
sudo /etc/init.d/apache2 restart
Yay! Installed and working!
A quick test of a Rails application …
EUWW!! WEBRICK!!
22:01
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! :)
Related posts (automatically calculated)

