Rubyonrails enabled!

I have installed Ruby on my FreeBSD 5.4 RELEASE, rubygems, rails, FastCGI and mod_fastcgi.. and walla, i’m riding on rails 😀


Below i jot it down, how to install ruby on rails in FreeBSD. For this case, I will install ruby 1.8.4, rubygems, rails, FastCGI 2.4.0 and mod_fastcgi 2.4.2 on a FreeBSD 5.4 RELEASE machine.

#Get all the files needed.
cd /usr/local/src/

# Install ruby on the system.
tar -zxf ruby-1.8.4.tar.gz
cd ruby-1.8.4
./configure && make && make install && cd ..

# Install rubygems-0.8.11
tar -zxf rubygems-0.8.11.tar.gz
cd rubygems-0.8.11
ruby setup.rb

# Install rails
gem install rails -y

# Install FastCGI
tar -zxf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure && make && make install && cd ..

# Install mod_fastcgi
tar -zxf mod_fastcgi-2.4.2.tar.gz
cd mod_fastcgi-2.4.2
apxs -o -c *.c
apxs -i -a -n fastcgi

# Create fcgi temp directorys
mkdir /tmp/fcgi_ipc/
mkdir /tmp/fcgi_ipc/dynamic/
chmod -R 777 /tmp/fcgi_ipc/

# Add an module entry into httpd.conf

FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
FastCgiWrapper /usr/sbin/suexec

#Restart httpd. You might need to apply your own way to do this, depending on your system.
/usr/local/etc/rc.d/httpd restart

The environment of each website hosted for ruby on rails also need to be created. The guide below will be specifically for direct admin. Root document of each server in DirectAdmin is configured at /home/example/domains/, example and is for this example only

cd /home/example/domains/
rails rails_app
mv public_html old_public_html
ln -s rails_app/public public_htm
cd rails_app
chmod 755 public

And, you can point your browser to, and you will be riding on rails too! 😀 Create your controllers/models, configure your routes, configure your database file, and you’re off! You can start working on Ruby applications on rails

The above guide are just to prepare the system for ruby on rails environment..For the development part, this link would be good for you.
Howtos in Ruby on Rails

Will come up more in ruby 😉

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.