Ruby on Rails Hosting

Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language. In other words, Ruby on Rails (ROR) is Ruby programming language web framework for developing online applications for the World Wide Web (the Internet). It is intended to be used with an Agile development methodology which is used by web developers for rapid development. It follows the MVC (Model View Controller pattern) for development of web applications. It is not popular as other programming languages but there are good number of developers who develop apps. Popular websites use Rails including: twitter.com (micro blogging service), scribd.com (document-sharing website), github and many others.

HostGator also offers Ruby on Rails (RoR) Web Hosting. This webhosting is rated as the leading web hosts for ruby hosting. Below is described in brief about general aspects of Ruby and Rails.

The Ruby
Ruby is an object-oriented programming language with an extremely clean syntax that makes programming easy and fun. It is a super productive new way to develop web applications. Ruby efficiently combines Smalltalk’s conceptual elegance. Moreover it also combines Python’s ease of use and learning, also Perl’s pragmatism. Ruby originated in Japan in the early 1990s, and since then has become popular worldwide and with the increase in the number of English language books and documentation it is set to grow further.

The Rails
Rails is an open source Ruby framework for developing database-backed web applications. Rails is much faster than dozens of other frameworks. Rails allow its users to develop a web application at least ten times faster with Rails than they could with a typical Java framework. This allows the user to make a web page much faster than other frameworks that too without actually making sacrifices in the quality.

Ruby programming language is partly the reason behind it. Many things that are very easy to do in Ruby are impossible in most other languages. Rails use this advantage of Ruby to its full advantage. Other factors effecting Rails are two of its guiding principles:
* Less software: It means that customers have to write fewer lines of code to implement their application. Smaller code means faster development and fewer bugs. Making the code easier to understand. Not just understand it makes code easy to maintain and enhance. In a nut shell Rails significantly cuts down the burden of code.
* Convention over configuration: In an end to verbose XML configuration files. These files do not exist in Rails. Instead of configuration files, a Rails application uses a few simple programming conventions that allow it to figure out everything through reflection and discovery. The application code and their running database already contain everything that Rails needs to know.

ROR with HostGator
HostGator supports ROR on all its shared and reseller servers. Ruby on HostGator comes with the preinstalled gems including action mailer, actionpack, actionwebservice, activerecord, activesupport, bluecloth, builder, daemons, feedtools, gemplugin, gnuplot, htmltools, mongrel, mysql, payment, rake, sources, tidy, uuid tools, xml-simple and others. One will need SSH access to develop Ruby applications. Ruby on Rails support on HostGator servers now applies to all shared and reseller servers. The following is a brief overview on how users can use RoR with HostGator servers.

HostGator has released its update version of Ruby named as ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]. The new Gem Version is Gem 1.0.1and the Rails Version is Rails 2.0.2. Although the custom gems are also available on a per request basis and if the user need an additional gem installed, they need to create a support ticket.

However HostGator has selected the following Gems to be preinstalled with the Ruby installations:
1. Actionmailer:    Service layer for easy email delivery and testing.
2. Actionpack:    Web-flow and rendering framework putting the VC in MVC.
3. Actionwebservice:    Web service support for Action Pack.
4. Activerecord:    Implements the ActiveRecord pattern for ORM.
5. Activesupport:    Support and utility classes used by the Rails framework.
6. BlueCloth:    BlueCloth is a Ruby implementation of Markdown, a text-to-HTML conversion tool for web writers. Markdown allows user to write using an easy-to-read, easy-to-write plain text format and then convert it to structurally valid XHTML (or HTML).
7. Builder:        Builders for MarkUp.
8. Daemons:    A toolkit to create and control daemons in different ways
9. Feedtools:    Parsing, generation, and caching system for xml news feeds.
10. gem_plugin:    A plug-in system based only on ruby gems that uses dependencies only
11. gnuplot:        Utility library to aid in interacting with gnuplot
12. HTML tools:    This is a Ruby library for building trees representing HTML structure.
13. Mongrel:    A small fast HTTP library and server that runs Rails, Camping, and Nitro apps.
14. Mysql:        MySQL/Ruby provides the same functions for Ruby programs that the MySQL C API provides for C programs.
15. Payment:    Payment is used to process credit cards and electronic cash through merchant accounts.
16. Rails:        Web-application framework with template engine, control-flow layer, and ORM.
17. Rake:        Ruby based make-like utility.
18. Sources:        This package provides download sources for remote gem installation
19. Tidy:        Ruby interface to HTML Tidy Library Project
20. Uuidtools:    Generation of UUIDs.
21. XML simple:    A very simple API for XML processing.

Steps to deploy a demo Rail application
Following are the steps the user can perform to deploy a demo Rail application and test its working on its HostGator account.

Step 1.    The user needs to Login to the SSH using its own account.

Step 2.    Once logged in, the user needs to make sure that it is in account at /home/username folder location using the “pwd” command. It should show the output like this:
Code:
cpaneluser@server [~]# pwd
/home/cpaneluser

Step 3.    The user then needs to run the following commands to generate a demo rail application and its controller.
Code:
cpaneluser@server [~]# rails /home/cpaneluser/demoapp
cpaneluser@server [~]# cd demoapp
cpaneluser@server [~]# ruby script/generate controller test

Step 4.    Now the user needs to create a symlink in public_html folder so that the application is viewable via the web.
Code:
cpaneluser@server [~]# cd ../public_html
cpaneluser@server [~]# ln –s ../demoapp/public rails

Step 5.    Now before the user can test the Rails page, there is one more modification it needs to make.
Code:
cpaneluser@server [~]# cd ../demoapp/public
cpaneluser@server [~]# pico .htaccess

Step 6.    The user then needs to locate the line where it has the code like below:
Code:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Step 7.    The user then needs to change that code to:
Code:
DirectoryIndex dispatch.fcgi
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Step 8.    The user now needs to save the file and with this all the desired is done. The application is ready for the test run.

Comments are closed.