Getting Ruby and Rails working on Ubuntu Intrepid

Installing Ruby on rails isn’t yet perfected using Ubuntu apt-get.

Instead: install Ruby from apt-get but download/install RubyGems from source.  This will avoid conflicts between apt-get and gem.

Install Ruby from apt-get.
$ sudo apt-get install ruby irb ri rdoc ruby1.8-dev libzlib-ruby libyaml-ruby libreadline-ruby libncurses-ruby libcurses-ruby libruby libruby-extras libfcgi-ruby1.8 build-essential libopenssl-ruby libdbm-ruby libdbi-ruby libdbd-sqlite3-ruby sqlite3 libsqlite3-dev libsqlite3-ruby libxml-ruby libxml2-dev

Download the latest RubyGems (currently 1.3.1) from rubyforge:

cd rubygems-1.3.1
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update –system
sudo gem install rails
sudo apt-get install build-essential ruby1.8-dev
sudo gem install mongrel
sudo apt-get install mysql-server mysql-client mysql-admin mysql-query-browser libmysqlclient15-dev  libdbd-mysql-ruby
sudo gem install mysql
sudo apt-get install sqlite3 swig libsqlite3-ruby libsqlite3-dev
sudo gem install sqlite3-ruby
echo “export RUBYOPT=rubygems” >> ~/.profile

rails path/to/your/app

(or rails path/to/your/app -d mysql to set app up to use MySQL for database operations)

This entry was posted in Linux, Web/Tech. Bookmark the permalink.