Home » Computers

Know the Basics in ROR

Jul 1, 2008
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 127.0.0.1.

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
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
end
end

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
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.2.tar.gz
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
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
About the Author
Jon Caldwell is a professional content manager. Much of his articles can be found at http://rubyonrailsprogrammingtips.com
Rating:
Please Rate:
(Average: Not rated)
Views: 189
Print Email Report Share
Article Categories
    • Artists
    • Gambling
    • Humanities
    • Humor
    • Movies
    • Music
    • Photography
    • Tattoos
    • Television
    • Classic Cars
    • Motorcycles
    • Recreational Vehicles
    • SUVs
    • Trucks
    • Vans
    • Branding
    • Business Opportunities
    • Careers and Jobs
    • Corporate
    • Customer Service
    • Direct Mail
    • Entrepreneurship
    • Ethics
    • Financing
    • Franchising
    • Home-Based Business
    • Human Resources
    • Import and Export
    • Leadership
    • Management
    • Market Research
    • Marketing and Advertising
    • Negotiation
    • Network Marketing
    • Networking
    • Organizational
    • Presentation
    • Project Management
    • Public Relations
    • Small Business
    • Strategic Planning
    • Team Building
    • Telemarketing
    • Training
    • Ask an Expert
    • College and University
    • Home Schooling
    • K-12
    • Languages
    • Online Education
    • Psychology
    • Accounting
    • Credit
    • Currency Trading
    • Debt Consolidation
    • Insurance
    • Investing
    • Leasing
    • Loans
    • Mortgage
    • Mutual Funds
    • Personal Finance
    • Stock Market
    • Structured Settlements
    • Taxes
    • Wealth Building
    • Coffee
    • Cooking
    • Gourmet
    • Recipes
    • Wine and Spirits
    • Acne
    • Aerobics
    • Alternative Medicine
    • Beauty
    • Cancer
    • Cosmetics
    • Depression
    • Diabetes
    • Diseases and Conditions
    • Fitness Equipment
    • Fitness
    • Hair Loss
    • Heart Disease
    • Medicine
    • Men's Health
    • Muscle Building
    • Nutrition
    • Skin Care
    • Supplements and Vitamins
    • Weight Loss
    • Women's Health
    • Yoga
    • Arts and Crafts
    • Babies
    • Collecting
    • Elderly Care
    • Genealogy
    • Hobbies
    • Parenting
    • Pets
    • Pregnancy
    • Woodworking
    • Feng Shui
    • Gardening
    • Home Appliances
    • Home Security
    • Interior Design
    • Landscaping
    • Affiliate Programs
    • Article Marketing
    • Auctions
    • Audio
    • Banner Advertising
    • Blogging
    • Broadband
    • Domain Names
    • E-Books
    • E-Commerce
    • Email Marketing
    • Ezines and Newsletters
    • Forums
    • Internet Marketing
    • Link Popularity
    • Pay-Per-Click
    • Podcasting
    • RSS
    • Search Engine Marketing
    • Search Engine Optimization
    • Security
    • Social Media
    • Spam
    • Video
    • Viral Marketing
    • Web Design
    • Web Development
    • Web Hosting
    • Copyright
    • Cyber Law
    • Intellectual Property
    • National, State, Local
    • Patents
    • Regulatory Compliance
    • Trademarks
    • Buying
    • Selling
    • Baseball
    • Basketball
    • Boating
    • Cycling
    • Extreme Sports
    • Fishing
    • Football
    • Golf
    • Hockey
    • Hunting
    • Martial Arts
    • Running
    • Scuba Diving
    • Soccer
    • Swimming
    • Tennis
    • Dating
    • Divorce
    • Marriage
    • Weddings
    • Astrology
    • Buddhism
    • Christianity
    • Faith
    • Hinduism
    • Islam
    • Judaism
    • Meditation
    • Metaphysical
    • New Age
    • Cable and Satellite TV
    • Cell Phones
    • Communication
    • Gadgets and Gizmos
    • GPS
    • Satellite Radio
    • Video Conferencing
    • VoIP
    • Addictions
    • Coaching
    • Goal Setting
    • Motivational
    • Stress Management
    • Time Management
    • Clothing
    • Electronics
    • Fashion
    • Gifts
    • Jewelry
    • Causes and Organizations
    • Environment
    • History
    • Holidays
    • Men's Issues
    • Nature
    • Philosophy
    • Politics
    • Women's Issues
    • World Affairs
    • Air Travel
    • Camping
    • Cruises
    • Destinations
    • Outdoors
    • Article Writing
    • Book Reviews
    • Copywriting
    • Fiction
    • Non-Fiction
    • Poetry
    • Quotes
    • Screenplay
    • Tools and Resources