teh bigbro blog(tm)
Bigbro's foray into the scary world of blogging
Sun, 09 Jan 2011
How to install Ruby On Rails on Ubuntu 10.10 (maverick)
For the interminably lazy, this is how I installed a test instance of Ruby on Rails on a virtual machine for testing purposes recently. it may not be the best way of installing things, but it's working for me and I content that this is the
shortest set of instructions you'll find on the matter ;-)
- Build a standard Ubtuntu 10.10 server instance. (I used 512M RAM + 20G drive for a virtual test server on VirtualBox.)
- aptitude install ruby-full build-essential (note that this installs emacs. Srsly? wtf?!?)
- aptitude install mysql-server mysql-client libmysql-ruby libmysqlclient-dev (installs MySQL and adaptor packages.)
- aptitude install rubygems1.9.1 (install ruby gems)
- ln -s /usr/bin/gem1.9.1 /usr/bin/gem (Yes - the package actually doesn't bother to alias it to 'gem' ... *sigh*)
- Discover that the above step has failed and realise that the package is so awful it will not remove itself, pretty much no matter what you do.
- Download the latest gem package from http://rubygems.org/pages/download
- untar-gz it and run 'ruby setup.rb' in the directory.
- rm /usr/bin/gem && ln -s /usr/bin/gem1.8 /usr/bin/gem (Unbreak the brokenness of gem1.9.1 and its packaging for Debian/Ubuntu.)
- gem update --system (Update the gem installer itself.)
- gem install mysql (install the MySQL adaptor)
- gem install rails (install rails itself.)
- Test your rails installation to make sure everything is working:
- rails new myrailsapp -d mysql
- edit myrailsapp/config/database.yml to make sure the MySQL socket location points to the right place. On Ubuntu it should be /var/run/mysqld/socket.sock
- Test your project by running 'rails server' in the project's root dir.
- Realise that the mysql2 gem is also secretly required. Find this out by running 'bundle install' and it'll put it in (and any other missing bits) automatically.
Now everything should work. Enjoi! Remember to create the databases in MySQL before trying to use them, and grant whatever user/password combination access to at least create and delete tables in the development, test and production databases before running a 'rake db:migrate'
posted at: 02:16 | path: /technical | permanent link to this entry

copyright © 2005-2008, Gareth Eason