CCH : These are the steps that I took to install Ruby on Rails to an IBM Thinkpad with 1G RAM and a 75G Hard Disk and installed with Ubuntu 9.04.
Ruby installation
Firstly, I clicked Applications/Accessories/Terminal to launch the Terminal and typed the following command to update the repositories.sudo apt-get update
sudo apt-get dist-upgrade
On succesful updating, I started to install Rails.
sudo apt-get install ruby ri rdoc irb libopenssl-ruby ruby-dev
Note : Rails prerequisites include :-
ruby = An interpreter of object-oriented scripting language Ruby
ri = Ruby Interactive reference
rdoc = Generate documentation from ruby source files
irb = Interactive Ruby
Ruby Gem installation
Next, I started to install the Ruby gem package manager by firstly downloading ad the latest Ruby gems .35 via the following link.http://rubyforge.org/projects/rubygems/
Download and extract the files.
tar xvzf rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby setup.rb
cd rubygems-1.3.5
sudo ruby setup.rb
I then deleted the .tgz file and rubygems directory.
cd ..
rm -r rubygems-1.3.5 rubygems-1.3.5.tgz
rm -r rubygems-1.3.5 rubygems-1.3.5.tgz
Next, I set out to create a set of simlinks. Otherwise it will be a tedious task to type commands with the version (1.8). For an example if we need to call the gem command we’ve to type gem1.8.
sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri
sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri
sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb
Rails Installation
I then installed Rails using gem.sudo gem install rails
Server Installation
FYI, Rails by default comes with the WEBrick server. But like most Rails developers, I prefer the Mongrel server and typed the following command to install Mongrel server as well as passenger 2.2.4 and capistrano 2.5.8 for deployemnt purposessudo gem install mongrel passenger capistrano
sudo apt-get install ruby-dev
Rails 2.3 shipped with SQLite3 as it’s default database instead of MySQL. You can install SQLite3 libraries by following commands.
sudo apt-get install sqlite3 swig libsqlite3-ruby libsqlite3-dev
sudo gem install sqlite3-ruby
sudo gem install sqlite3-ruby
sudo apt-get install mysql-client libmysqlclient15-dev
sudo gem install mysql
sudo gem install mysql
Create Ruby on Rails App
With no error mesages, I proceeded to create a new Ruby on Rail application by following command :-rails test_app
rails test-app -d mysql
Run the app
cd test_app
script/server
script/server
and bingo I succeeded in launching my first RoR apps on Ubuntu :-)
No comments:
Post a Comment