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/
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.4.tar.gz
wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
wget fastcgi.com/dist/fcgi-2.4.0.tar.gz
wget fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
# 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 mod_fastcgi.so -c *.c
apxs -i -a -n fastcgi mod_fastcgi.so
# 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.com/public_html, example and example.com is for this example only
cd /home/example/domains/example.com
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 example.com, 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 😉