Getting started with Ruby on rails

By: Emiley J. Emailed: 1586 times Printed: 2041 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

First of all you have to check whether Ruby is already installed in your computer. To do that you can follow these steps.

Ruby runs on Windows 2000, Windows XP, or later; Mac OS X; and any version of Unix you’re likely to find. You may already have Ruby installed on your machine. To find out, type this at the command

prompt:

prompt> ruby -v

If you see a complaint like “command not found,” you’ll have to install Ruby.

If Ruby is installed, the response will look something like this:

ruby 1.8.1 (2003-12-25) [powerpc-darwin]

Installing Ruby

in Windows

There is a one-click Ruby installer. You can find it here: http://www.ruby-lang.org/en/downloads/. After you download it, double-click it in Windows Explorer to run it, and then follow the directions. After installing Ruby, close any command-line windows, open a new one, and then follow the directions above to check the installation.

in Mac OS X

Tiger (version 10.4) and later versions of Mac OS X come with recent enough versions of Ruby. If you’re using an older release of OS X, see http://www.ruby-lang.org/en/downloads/

Other Unix Variants

You may be able to find precompiled versions of Ruby (RPMs, etc.) in the usual places and retrieve them via the usual tools (apt-get, pkg-get, ports, etc.).

Your Two Basic Tools to use Ruby on rails

There are two basic tools: an editor and an interpreter.

Your Editor

You can use any editor that works with text files to create Ruby scripts. On Windows, I recommend you use SciTE, which is installed with Ruby. It’s more than just a text editor: it understands Ruby well enough to color-code parts of a script to make it easier to read, and it lets you run scripts without having to switch to the command line. (In the Start menu’s Programs entry, you’ll find a Ruby entry, and SciTE is under that.)

On a Mac, I recommend TextMate (http://macromates.com/). It costs money, but you can try a free download. On the Mac and other Unix-like systems, you can use pico. It’s free. Start it by typing its name at the command prompt. It shows its available editing commands at the bottom of the screen. In that help,

Control + X is denoted by ˆX.

If you use the Gnome window system on Linux, gedit is worth trying.

irb

The second useful tool is irb. It lets you try your ideas without having to write a whole script. You can type a little snippet of Ruby and quickly check what it does. Now check that irb is ready for use. At the command prompt, type the following. (Remember not to include the prompt.)

prompt> irb

You’ll see something like this:

irb(main):001:0>

Most of the pieces of the prompt are unimportant. Now type a Ruby expression, and press Enter (on Windows) or Return (on Unix-like systems):

irb(main):001:0> 1+1

=> 2

irb(main):002:0>

irb displays the result and then prompts you to type something more. 2 is the result of evaluating the expression 1+1.

Exit from irb like this:

irb(main):003:0> exit

prompt>


Ruby Home | All Ruby Tutorials | Latest Ruby Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(1)


1. View Comment

Thanks dear

View Tutorial          By: Muthin at 2009-04-29 00:32:24

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Emiley J.
Error generating R.java from manifest
ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client
IIS and Tomcat - how to configure to work together
PHP Warning: Unknown(): Unable to load dynamic library '/usr/local/php4/lib/php/extensions/no-debug ......
Adding your own Application icon for your J2ME application (jar file)
Creating Menus in Code using VB.net
Traversing all files in a directory using Ruby
Using Proxy to connect to URLs in Ruby
POST a form in Ruby
Reading URL content using Ruby (HTTP)
dRuby client/server mode sample program
Benchmark module in Ruby
encoding and decoding in Ruby using Base64 Module
Module Abbrev in Ruby
Standard Library Packages in Ruby

More Tutorials in Ruby
Standard Library Packages in Ruby
Module Abbrev in Ruby
encoding and decoding in Ruby using Base64 Module
Benchmark module in Ruby
benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) {|report| ...} in Ruby
bm(label_width = 0, *labels) {|report| ...} in Ruby
bmbm(width = 0) {|job| ...} in Ruby
CGI class in Ruby
URL encode a string in Ruby
escapeElement() in Ruby
escapeHTML() in Ruby
new(type = "query") in Ruby
parse(query) in Ruby
pretty() in Ruby
Format a Time object as a String in Ruby

More Latest News
Most Viewed Articles (in Ruby )
Reading URL content using Ruby (HTTP)
encoding and decoding in Ruby using Base64 Module
Command-line Arguments in Ruby on rails
unless in Ruby on rails
escapeElement() in Ruby
parse(query) in Ruby
out() in Ruby
Open and manipulate CSV files in Ruby
date and time in Ruby
Sending emails using SMTP in Ruby
Getting started with Ruby on rails
Prompts, Command Lines, Prompts, and irb in Ruby on rails
Methods in Ruby on rails
if . . . elsif . . . else in Ruby on rails
The Question Mark Operator in Ruby on rails
Most Emailed Articles (in Ruby)
header() in Ruby
unescapeElement() in Ruby
The Question Mark Operator in Ruby on rails
What is dRuby?
Command-line Arguments in Ruby on rails
parse(query) in Ruby
POST a form in Ruby
Reading emails using POP3 in Ruby
Module Abbrev in Ruby
bm(label_width = 0, *labels) {|report| ...} in Ruby
CGI class in Ruby
URL encode a string in Ruby
escapeElement() in Ruby
new(type = "query") in Ruby
pretty() in Ruby