Installing Ruby and Rails (not Updated)

Ubuntu

This section illustrates how to install Ruby on Ubuntu.
Note that there may be other installation ways, but this one is the one most generic ones, and the one we use.

Installing Ruby

Open up a console and run:

sudo aptitude update
sudo aptitude install ruby build-essential libopenssl-ruby ruby1.8-dev

Installing Rubygems

Prerequisites

Step by Step

Download from http://rubygems.org/pages/download.
Unpack into a directory and cd there.
Install with: ruby setup.rb (you may need admin/root privilege)

Example:

Open a console and run the following commands:

mkdir ~/src && cd ~/src
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar xvvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
sudo ruby setup.rb

Warning

It is possible that binaries installed by rubygems won't be found by default. This may happen because the EXECUTABLE DIRECTORY of rubygems isn't properly configured. To avoid this, change the rubygems setup line to this:

sudo ruby setup.rb --prefix=/usr/local

Gem binary path

It is possible that gem binary is named "gem1.8" instead of "gem". To solve this, you can just make a symbolic link:

sudo ln -s $(which gem1.8) /usr/local/bin/gem

Reduce gem install time:

By default "gem install" also generates both ri and rdoc documentation. This can drastically increase the installation time of some gems. To avoid this you can put this in ~/.gemrc

gem: --no-rdoc --no-ri

Installing Rails

Prerequisites

Step by Step

Open a console and run:

sudo gem install rails

Installing Mysql and Mysql Adapter

Open a console and run:

sudo apt-get install mysql-server mysql-client
sudo apt-get install libmysql-ruby libmysqlclient-dev
sudo gem install mysql

Mac OSX Snow Leopard

This section illustrates how to install Ruby on Mac OsX Snow Leopard.
Note that there may be other installation ways, but this one is the one most generic one, and the one we have been using with success.

NOTE: before following this steps, make sure you do not have rails and rubygems already installed.

Open a console and run:

gem -v

At least the gem version must be 1.3.5.

Pre Requisites

TODO

Installing Ruby

TODO

Installing Rubygems

TODO

Installing Mysql Adapter

Install Mysql first

Open a console and run:

sudo gem install mysql

After that you should be able to use Mysql in your rails applications.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License