home

Ruby on Rails on Centos 5.2

Buy Himcolin No Prescription Tenormin No Prescription Chitosan For Sale Buy Requip Online Buy Online Soma Buy Vasotec No Prescription Proventil No Prescription Zoloft Ultram For Sale Buy Lukol Online Buy Online Lexapro Buy Ultram No Prescription Styplon No Prescription Imitrex For Sale Buy Lincocin Online Buy Online Coumadin Buy Accutane No Prescription Prozac No Prescription Calan For Sale Buy Tentex Royal Online Buy Online Emsam Buy Snoroff No Prescription Lasuna No Prescription Brafix For Sale Buy Toprol XL Online Buy Online Kytril

Installing / Configuring
On a base install, first get the dependencies:

sudo yum install ruby httpd httpd-devel gcc gcc-c++ readline readline-devel zlib zlib-devel openssl openssl-devel gettext-devel expat-devel curl-devel

You can check to see if the version of ruby is acceptable, if not, it’s easy to install from source.  As of this writing, that was version 1.8.5, which is old.  Centos-plus still doesn’t have a newer version.  Grab a copy of ruby from http://www.ruby-lang.org/en/downloads/:

wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz

While you’re at it, grab a copy of rubygems from http://rubyforge.org/frs/?group_id=126

wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz

Untar, extract ruby:

tar xzvf ruby-1.8.7-p72.tar.gz
cd ruby-1.8.7
./configure
make
sudo make install

Untar, extract rubygems:

cd ..
tar xzvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
sudo ruby setup.rb

Note that I had to logout and log back in (re-run profile) to ensure that the new ruby installed in /usr/local/bin was being read, and not the ruby in /usr/bin.  Tested with ruby -v.

Next, install rails:

sudo gem install rails

Install your Database of choice (you may want postgres, other dbs):

sudo yum install mysql mysql-server mysql-devel

And install any other gems:

sudo gem install mysql — \
–with-mysql-include=/usr/include/mysql \
–with-mysql-lib=/usr/lib/mysql

Note: Felippe Silvestre reports that he had to add an additional mysql_config option on his install (it has also been reported that only supplying the mysql_config option works, your results may vary):

sudo gem install mysql — \
–with-mysql-include=/usr/include/mysql \
–with-mysql-lib=/usr/lib/mysql \
–with-mysql-config=/usr/lib/mysql/mysql_config

Install passenger (mod_rails):

sudo gem install passenger
sudo passenger-install-apache2-module

Follow the directions for passenger, and you’re done.

Troubleshooting

If apache won’t start after installing passenger, make sure you’re SELinux is not enabled.  I couldn’t get it to work with enabling the correct permissions using chcon, so I just disabled by:

echo 0 >/selinux/enforce

and then turning it off on reboot by editing /etc/selinux/config and setting it to permissive (instead of enforcing).

If you get errors abour readline when running script/console for Rails, it probably means that ruby was not compiled with readline (readline-devel) support.  If you skipped installing the readline-devel packages, this can happen.