User Tools

Site Tools


ruby:rails:start

Ruby on Rails

Sub Sites

Hosting Rails applications

Install Ruby, rubygems & Rails

Install ruby

yum install ruby ruby-devel

Install rubygems

wget http://<rubygems>
tar xzfv <rubygems>.tar
cd rubygems
ruby setup.rb

Install Rails

gem install rails

MySQL support

gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

or alternatively

gem install mysql -- --with-mysql-dir=/usr/local/mysql

Install Ruby & rubygems from source

Include /usr/local/bin into your path:

export PATH=/usr/local/bin:$PATH

Do the following to add the path permanently:

vim  /etc/profile.d/ruby.sh

Enter this export statement:

# include the ruby binary (sh)
export PATH=/usr/local/bin:$PATH

Compile / install ruby:

wget http://rubyforge.org/frs/download.php/25689/ruby-1.8.6-p110.tar.gz
tar -xzvf ruby-1.8.6-p110.tar.gz
cd ruby-1.8.6-p110
./configure --prefix=/usr/local
make
make install

Check if ruby is installed properly:

# ruby -v
ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-linux]
# which ruby
/usr/local/bin/ruby

Install rubygems:

wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
tar -xzvf rubygems-1.2.0.tgz
cd rubygems-1.2.0
ruby setup.rb

Freeze Rails Applications

Ruby on Rails allows you to “freeze” the version of Rails used by your application. When you freeze Rails, your application will always use that version of Rails and the associated Ruby Gems, regardless of what version is installed on the server. You can choose which version of Rails you want to freeze to.

Freezing Rails is recommended if you are using a Rails application for a business site or another production environment where stability is the most important concern. If you don't freeze your application, there is a small possibility that your application might stop working due to compatibility problems when a new version of Rails is installed on our servers.

However, keep in mind that if you freeze your application to use a current (or older) version of Rails, you will not get the security benefits of automatic upgrades. You should make sure you're keeping track of Rails versions yourself (for example, by subscribing to the Rails mailing lists) and upgrading your frozen version of Rails as necessary.

freeze

Change to the application directory and run the following command to freeze this application to the version of Rails that is currently on our servers.

rake rails:freeze:gems

You can also define a explicit rails version:

rake rails:freeze:gems RELEASE=2.3.0

Show the version actually installed:

ruby script/about

unfreeze

Unfreeze a frozen version with this command:

rake rails:unfreeze
/srv/wiki.niwos.com/data/pages/ruby/rails/start.txt · Last modified: 2012/11/09 13:16 by niwo