Ruby on Rails for RHEL 5

Here is the quick and dirty Ruby on Rails setup for Redhat Enterprise Linux v5.0 with MySQL.

(2009-12-04 Update: This does not work with RHEL 5.4. The mysql ruby gem requires ruby 1.8.6 and RHEL 5.4 only ships with ruby 1.8.5)

Using yum install ruby and mysql. The command below does not list all the required packages, but due to dependencies, the additional packages will be installed (or should be – this is all from memory).
(more…)

Tagged with:
 

When displaying a list that requires information from several tables in the database, you can sometimes end up with three or more database queries per list row. Depending on the situation, this may not be a problem. However, it is possible to join the tables in one large SQL query using the :include option.

# :include example
#
@requests = Request.find(:all, :include => [:department, :status])

Using the :include option may improve performance. However, it will likely use more server memory and could potentially return a lot of data through the joins that may not even be used.

Tagged with: