星期一, 3月 26, 2007

ror installation

My steps to install Ruby On Rails 1.8.5 over ubuntu 6.0.6

Prep
Make sure you have gcc complier and zlib development package installed. If not sure, please run

apt-get install build-essestial
apt-get install zlib1g-dev
Ruby
Download ruby-1.8.5-p12.tar.gz from http://www.rubyonrails.org
tar xzvf ruby-1.8.5-p12.tar.gz
cd ruby-1.8.5-p12
./configure --prefix=/usr/local --enable-pthread
make
sudo make install
sudo make install-doc
cd
..
If you saw lots of text fly by but didn’t get that error, it means that we should now have a brand new Ruby installed.

We can verify this (as well as a correct path setting) by typing the following command:

ruby -v
You should see something like this:
ruby 1.8.5 (2006-12-04 patchlevel 2) [i686-linux]
zLib
Download zlib package from
http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
tar zxvf ruby-zlib-0.6.0.tar.gz
cd ruby-zlib-0.6.0
ruby extconf.rb
make
sudo make install
cd ..
RubyGems
Download rubygems package rubygems-0.9.2.tgz from
http://rubyforge.org/projects/rubygems/
tar xzvf rubygems-0.9.2.tgz
cd rubygems-0.9.2
sudo /usr/local/bin/ruby setup.rb
cd ..
RubyOnRails
With RubyGems installed, Rails is a simple, one-line install:
sudo gem install rails --include-dependencies
* gem respects the following variables for proxy settings
  • http_proxy
  • HTTP_PROXY
  • NO_PROXY

2 則留言:

Unknown 說...

The first two lines should be
apt-get install build-essential
apt-get install zlib1g-dev

Just typo ~

WK 說...

when installing ruby 1.8.6, it may show this error
"/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:159:in
`require_frameworks': no such file to load -- openssl (RuntimeError)"

To solve this
(1) sudo apt-get install libssl-dev
(2) go to ruby_source/ext/openssl and run extconf.rb (and
then make; make install)

After than the error should be gone