Install a Ruby on Rails Zone
Install a new zone called ruby_zone and login.Build and Install Ruby From Source
- root@ruby_zone:~# mkdir /usr/opt/sources
- root@ruby_zone:~# cd /usr/opt/sources/
- root@ruby_zone:/usr/opt/sources# wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
- root@ruby_zone:/usr/opt/sources# gunzip ruby-1.8.6.tar.gz
- root@ruby_zone:/usr/opt/sources# tar -xf ruby-1.8.6.tar
- root@ruby_zone:/usr/opt/sources# cd ruby-1.8.6
- root@ruby_zone:/usr/opt/sources/ruby-1.8.6# apt-get install make gcc
- root@ruby_zone:/usr/opt/sources/ruby-1.8.6# apt-get install zlib1g-dev (or else you will see an error that looks like remote_fetcher.rb:4:in `require': no such file to load -- zlib (LoadError) error when installing ruby gems)
- root@ruby_zone:/usr/opt/sources/ruby-1.8.6# ./configure --prefix=/usr/opt --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib
- root@ruby_zone:/usr/opt/sources/ruby-1.8.6# make
- root@ruby_zone:/usr/opt/sources/ruby-1.8.6# make test (expect to see a test succeeded message)
- root@ruby_zone:/usr/opt/sources/ruby-1.8.6# make install
Setup Ruby Gems
- root@ruby_zone:/usr/opt/sources/ruby-1.8.6# cd ..
- root@ruby_zone:/usr/opt/sources# wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz
- root@ruby_zone:/usr/opt/sources# gunzip rubygems-0.9.4.tgz
- root@ruby_zone:/usr/opt/sources# tar -xf rubygems-0.9.4.tar
- root@ruby_zone:/usr/opt/sources# cd rubygems-0.9.4
- root@ruby_zone:/usr/opt/sources/rubygems-0.9.4# /usr/opt/bin/ruby setup.rb
- root@ruby_zone:/usr/opt/sources/rubygems-0.9.4# /usr/opt/bin/gem update (or else you may see Could not find rails (> 0) in any repository)
Install the Rails Gem
- root@ruby_zone:/usr/opt/sources/rubygems-0.9.4# /usr/opt/bin/gem install rails --include-dependencies
- root@ruby_zone:/usr/opt/sources/rubygems-0.9.4# mkdir /tmp/test_rails
- root@ruby_zone:/usr/opt/sources/rubygems-0.9.4# /usr/opt/bin/rails /tmp/test_rails
- root@ruby_zone:/usr/opt/sources/rubygems-0.9.4# cd /tmp/test_rails
- root@ruby_zone:/tmp/test_rails# /usr/opt/bin/ruby script/server (expect WEBrick to start)
From a browser, open http://ipaddress.of.ruby_zone:3000 (I chose 192.168.0.115 as the ipaddress)
You should now see the Rails "Welcome aboard" screen!
No comments:
Post a Comment