Installing Ruby on Rails

Since Ruby on Rails was first released, it has become a household name (in developers’ households, anyway). Hundreds of thousands of developers the world over have adopted—and adored—this new framework. Firstly Ruby is a programming language which was written by a Japanese man Yukihiro “Matz” Matsumoto. Ruby on Rails is the Framework for Ruby and is used to build web based applications.

We will deal with manual installation techniques and use the command-line and installers for specific tasks as well as configure Instant Rails.

MANUAL INSTALLATION OF RUBY ON RAILS:

To start off we need to install some development software on our systems. The packages you can install are here (I will be dealing with ONLY Windows based systems here) :

The Ruby Language Interpreter:  
The Ruby interpreter translates our Ruby code (or any Ruby code, for that matter, including Rails itself) into a form the computer can understand and execute. At the time of writing, Ruby 1.8.6 is recommended for use with Rails, so that’s what I’ve used here.

The Ruby on Rails framework:  
Once we’ve downloaded Ruby, we can install the Rails framework itself. As I mentioned in Chapter 1, Rails is written in Ruby.

The SQLite database engine:
The SQLite database engine is a self-contained software library which provides an SQL database without actually running a separate server process. While Rails supports plenty of other database servers (MySQL, PostgreSQL, Microsoft SQL Server, and Oracle, to name a few), SQLite is easy to install and does not require.

Step One:  Installing Ruby the Programming Language:

The first place you need to look is at the Ruby on Rails website and download Ruby the Language – > http://www.rubyonrails.org .  Simply click on the Get Started icon which will take you into the downloads area.

Ruby on Rails Homepage

Ruby on Rails Homepage

On the Downloads Page click on the Windows installer.  

Rubys Windows Installer

Rubys Windows Installer

 You will be taken to Ruby Forge where you can download the .exe installer of Ruby.  Download that and install it on your local computer.  

Ruby Forge - One click Installer for Windows

Ruby Forge - One click Installer for Windows

I like keeping my C: drive empty so i installed in into D:/Ruby

Step Two: Installing Rails via the Command Prompt:

If you are not insterested in command line prompt then Rails aint for you.  Fire up the command line prompt on your Windows Based PC.  To get to it all you have to do is to navigate to “Accessories” in your Start Menu 
and look for Command Prompt.  Ok now fire up your installer, it should look like this:

Windows Command Prompt

Windows Command Prompt

To check what version of Ruby you are running type:
ruby --version

You should get the version number of Ruby on Rails which will be displayed in the command prompt.
Next you need to know what a Gem is. The Ruby Gem is the package manager that comes with Ruby that will help you install Rails and alot of other modules for later use.

To install Rails simply type:
gem install rails --include-dependencies

The gems package manager will take a minute to check the Rails repository to determine if Rails is installed. Obviously if it isn’t it will install it for you. Note that this will take some time as the packages are quite large.

That about does it for Rails. Make sure that Rails is working by creating an application. To do this you type:
rails Hello World
(where rails is the command and “Hello World” is the application that you are generating.)

After giving that command simply navigate to the folder where you ran the command from -> you should notice that Rails has created your skeleton structure for you already!

INSTANT RAILS:

1 Comment Installing Ruby on Rails

Leave a Reply

Your email address will not be published. Required fields are marked *