RPMs for Deploying Rails on CentOS
Thanks to mongrel, Ruby on Rails deployment is finally decent. Several weeks back I switched all of our servers over to using Apache 2.2 with mod\_proxy\_balancer, mongrel and mongrel\_cluster, and I haven't had any problems.
Unfortunately, since most of our servers run CentOS (repackaged RedHat Enterprise Server 4), the setup isn't as easy as it could be since it ships with Apache 2.0 and ruby 1.8.2, which doesn't work with Rails. So I've rebuilt all the necessary RPMs (and more) and made them available to make deploying a snap. Note: these packages should also work on RedHat Enterprise Linux 4, however, I have not tested them.
Download or create the yum config in
/etc/yum.repos.d/ file with the following contents:
[ci] name=[i] Collective Idea RPM Repository baseurl=http://source.collectiveidea.com/pub/linux/centos/4/i386 gpgcheck=1 enabled=1 gpgkey=http://source.collectiveidea.com/pub//RPM-GPG-KEY
To install the packages, run:
yum install httpd ruby ruby-devel rubygems ri
Note: If you already have Apache and other modules installed, this command may fail. You can try running
yum upgrade, or you may just need to remove the packages before you install the new packages. If you're using any packages, such as other Apache modules, that I haven't rebuilt against Apache 2.2, let me know and I can add them.
Install the gems you need by running:
gem install -y rails mongrel mongrel_cluster
Configure Apache and Mongrel
Let me know if you have any problems with these packages.