Wednesday February 27, 2008
Installing Ruby On Rails (ror) in Ubuntu
Installing ruby is a cinch, rails on the other hand has all sorts of dramas! So lets get into it!
Lets get some packages
The following packages basically installs ruby, the ruby headers, some compliers and ruby docs.
sudo apt-get install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby build-essential ruby1.8-dev
Gems
Now gems via apt-get breaks, its in a bit of a mess, and who ever created the .deb should be shot out of a cannon, I might create my own one day.
Here we just want to wget (download) the gems package, untar it and install it.
wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
tar xzvf rubygems-1.0.1.tgz
cd rubygems-1.0.1
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
update gems
if this fails, try again.. rubygems is about as reliable as a Melbourne's weather.
sudo gem update --system
Install Rails
Here we install rails via gems
sudo gem install rails --include-dependencies
MysQL
Here we will install mysql and the ruby wrapper/connector
sudo apt-get install mysql-client mysql-admin mysql-query-browser libmysqlclient15-dev
sudo gem install mysql
SQLite3
If you prefer SQLite, then this is for you! If you plan to use mysql (like I have, then you can skip this section)
sudo apt-get install sqlite3 swig libsqlite3-ruby libsqlite3-dev
sudo gem install sqlite3-ruby
Install Some Gems
Mongrel is a very good webserver for rails
sudo gem install mongrel
And there you have it, a fully fledged production install of ruby on rails. Its about as easy as that.
Back
