Know the Basics in ROR

by : Jon Caldwell

Ruby on Rails has focused on creating templates and designs that tackle the unglamorous problems. It is not also to create a sophisticated development framework that the engineers at Google or Amazon will flock to; it is like making a database modification that the great majority of Web developers face every day.

True to the ideals of web development, the Rails community is composed of people wanting to reach out to help others. This thriving community builds its foundation on the virtue of sharing knowledge with one another in order to help create a better virtual world and one of the many ways through which Ruby on Rails carry out this mission is by having mailing lists for its users. These mailing lists include: a) A general list where Rail users can discuss information and projects; b) A core list for issues concerning patches; c) Prototype talk on Javascript and Ajax, and; d) A security announcement list for critical patches.

The key to a successful online web development community is accurate and accessible documentation for everyone. That is why the Rails community came up with its own Rails wiki so that users can contribute information and other helpful tips to fellow Rails users. The Rails wiki has everything from the how-to's in getting started with Rails (installation guides, tutorials, books and FAQ, troubleshooting, tip sheet for beginners, etc.) to community announcements (trainings and job postings, development firms, etc.). One can also find in the Rails wiki the lists of online help groups for Rails users (forums, IRC, user groups, ProblemBase, etc.)

You can always debug your application and get it back on the rails if ever it something goes wrong. You have to check the application log files. See to it that "tail -f" commands are running on the server.log and development.log. Rails will then show debugging and runtime information to these files and debugging information will also be displayed in the browser on requests from

Using the Ruby logger class from inside your controllers, you can also log your own messages directly into the log file from your code like:

class WeblogController < ActionController::Base
def destroy
@weblog = Weblog.find(params[:id])
@weblog.destroy"#{} Destroyed Weblog ID ##{}!")

There are a lot of web servers that are compatible with Rails, but Apache and Lighttpd are said to be the most popular. Any web server that supports mod_ruby (Apache), CGI, or SCGI can be used for running Rails. You may also want to try tinkering with Lighttpd, which can rival Apache 2.0.54 in speed, by using MPM Worker on Debian 3.1 (claimed to be faster than Apache 1.x or2.x MPM Prefork). However, working with Lighttpd-1.4.10 can be very buggy so you might want to consider using Lighttpd-1.4.11 or a newer version instead. Zed Shaw's Mongrel, a ruby based webserver that utilizes Cextensions to increase performance, is also another good option. You can run Mongrel on its own or in a cluster behind an Apache or a Lighttpd proxy.

Create a directory for all of the software you are going to download and installed. In this example, the created directory is "temp" at the root of the files system, but you can use any name and location you like.

cd /
mkdir temp
chmod 775 temp

Now, download, configure and install Ruby. Wget is used in this example:

cd temp
tar -zxvf ruby-1.8.2.tar.gz cd ruby-1.8.2

Specify an install directory since there are times when you won't have permissions to install things in normal directories. Here, we can see the "configure" script for Ruby, creating a directory inside "/usr/local" for installation:

./configure -prefix=/usr/local/ruby -exec-prefix=/usr/local/ruby

Now, you have a Makefile that you can compile:

make install

Your Ruby is now installed. You should try making a symbolic link to Ruby somewhere in your local path:

ln -s /usr/local/ruby/bin/ruby /usr/local/bin/ruby