SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
RUBY ENVIRONMENT SETUP
http://www.tutorialspoint.com/ruby/ruby_environment.htm                                         Copyright © tutorialspoint.com



Before we proceed practically, it is important to have an up-to-date environment. This tutorial will teach you all the
important topics related to environment setup. I would recommend to go through the following topics first and then
proceed further:

       Ruby Installation on Unix : If you are planning to have your development environment on Unix Machine then go
       through this chapter.

       Ruby Installation on Windows : If you are planning to have your development environment on Windows
       Machine then go through this chapter.

       Ruby Command Line Options : This chapter list out all the command line options which you can use along with
       Ruby interpreter.

       Ruby Environment Variables : This chapter has a list of all the important environment variables to be set to make
       Ruby Interpreter works.

Popular Ruby Editors:

To write your Ruby programs you will need an editor:

       If you are working on Windows machine then you can use any simple text editor like Notepad or Edit plus.

       VIM (Vi IMproved) is very simple text editor. This is available on almost all Unix machines and now Windows
       as well. Otherwise your can use your favorite vi editor to write Ruby programs.

       RubyWin is a Ruby Integrated Development Environment (IDE) for Windows.

       Ruby Development Environment (RDE) is also very good IDE for windows users.

Interactive Ruby (IRb):

Interactive Ruby (IRb) provides a shell for experimentation. Within the IRb shell, you can immediately view expression
results, line by line.

This tool comes along with Ruby installation so you have nothing to do extra to have IRb working.

Just type irb at your command prompt and an Interactive Ruby Session will start as given below:

 $irb
 irb 0.6.1(99/09/16)
 irb(main):001:0> def hello
 irb(main):002:1> out = "Hello World"
 irb(main):003:1> puts out
 irb(main):004:1> end
 nil
 irb(main):005:0> hello
 Hello World
 nil
 irb(main):006:0>


Do not worry about what I did here. You will learn about all these steps in subsequent chapters.

What is Next?
I assume now you have a working Ruby Environment and you are ready to write first Ruby Programs. Next chapter will
teach you how to write Ruby programs.

Contenu connexe

Similaire à 03 ruby environment

An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystemGeison Goes
 
Ruby And Ruby On Rails
Ruby And Ruby On RailsRuby And Ruby On Rails
Ruby And Ruby On RailsAkNirojan
 
[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion
[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion
[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotionSrijan Technologies
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overviewThomas Asikis
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorialknoppix
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
How to be productive with Rails... even on Windows
How to be productive with Rails... even on WindowsHow to be productive with Rails... even on Windows
How to be productive with Rails... even on WindowsLuis Lavena
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with RubyAnis Ahmad
 
Drupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowDrupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowvaluebound
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projectsjazzman1980
 
Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)Muhammad Haseeb Shahid
 
【Primer】WebApp release in 3 hours! Programming from scratch Rails course
【Primer】WebApp release in 3 hours! Programming from scratch Rails course【Primer】WebApp release in 3 hours! Programming from scratch Rails course
【Primer】WebApp release in 3 hours! Programming from scratch Rails courseDIVE INTO CODE Corp.
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First MileGourab Mitra
 
From Ant to Rake
From Ant to RakeFrom Ant to Rake
From Ant to Rakejazzman1980
 

Similaire à 03 ruby environment (20)

01 index
01 index01 index
01 index
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystem
 
Ruby And Ruby On Rails
Ruby And Ruby On RailsRuby And Ruby On Rails
Ruby And Ruby On Rails
 
[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion
[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion
[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion
 
2 Basics
2 Basics2 Basics
2 Basics
 
FGCU Camp Talk
FGCU Camp TalkFGCU Camp Talk
FGCU Camp Talk
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Ruby Chapter 2
Ruby Chapter 2Ruby Chapter 2
Ruby Chapter 2
 
How to be productive with Rails... even on Windows
How to be productive with Rails... even on WindowsHow to be productive with Rails... even on Windows
How to be productive with Rails... even on Windows
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with Ruby
 
Rbenv
RbenvRbenv
Rbenv
 
Drupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowDrupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflow
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projects
 
Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)
 
【Primer】WebApp release in 3 hours! Programming from scratch Rails course
【Primer】WebApp release in 3 hours! Programming from scratch Rails course【Primer】WebApp release in 3 hours! Programming from scratch Rails course
【Primer】WebApp release in 3 hours! Programming from scratch Rails course
 
Athens Ruby Meetup #3: IronRuby
Athens Ruby Meetup #3: IronRubyAthens Ruby Meetup #3: IronRuby
Athens Ruby Meetup #3: IronRuby
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
 
From Ant to Rake
From Ant to RakeFrom Ant to Rake
From Ant to Rake
 

Plus de Walker Maidana (20)

20 ruby input output
20 ruby input output20 ruby input output
20 ruby input output
 
19 ruby iterators
19 ruby iterators19 ruby iterators
19 ruby iterators
 
18 ruby ranges
18 ruby ranges18 ruby ranges
18 ruby ranges
 
17 ruby date time
17 ruby date time17 ruby date time
17 ruby date time
 
16 ruby hashes
16 ruby hashes16 ruby hashes
16 ruby hashes
 
15 ruby arrays
15 ruby arrays15 ruby arrays
15 ruby arrays
 
14 ruby strings
14 ruby strings14 ruby strings
14 ruby strings
 
13 ruby modules
13 ruby modules13 ruby modules
13 ruby modules
 
12 ruby blocks
12 ruby blocks12 ruby blocks
12 ruby blocks
 
11 ruby methods
11 ruby methods11 ruby methods
11 ruby methods
 
10 ruby loops
10 ruby loops10 ruby loops
10 ruby loops
 
09 ruby if else
09 ruby if else09 ruby if else
09 ruby if else
 
08 ruby comments
08 ruby comments08 ruby comments
08 ruby comments
 
07 ruby operators
07 ruby operators07 ruby operators
07 ruby operators
 
06 ruby variables
06 ruby variables06 ruby variables
06 ruby variables
 
05 ruby classes
05 ruby classes05 ruby classes
05 ruby classes
 
04 ruby syntax
04 ruby syntax04 ruby syntax
04 ruby syntax
 
00 ruby tutorial
00 ruby tutorial00 ruby tutorial
00 ruby tutorial
 
02 ruby overview
02 ruby overview02 ruby overview
02 ruby overview
 
21 ruby exceptions
21 ruby exceptions21 ruby exceptions
21 ruby exceptions
 

03 ruby environment

  • 1. RUBY ENVIRONMENT SETUP http://www.tutorialspoint.com/ruby/ruby_environment.htm Copyright © tutorialspoint.com Before we proceed practically, it is important to have an up-to-date environment. This tutorial will teach you all the important topics related to environment setup. I would recommend to go through the following topics first and then proceed further: Ruby Installation on Unix : If you are planning to have your development environment on Unix Machine then go through this chapter. Ruby Installation on Windows : If you are planning to have your development environment on Windows Machine then go through this chapter. Ruby Command Line Options : This chapter list out all the command line options which you can use along with Ruby interpreter. Ruby Environment Variables : This chapter has a list of all the important environment variables to be set to make Ruby Interpreter works. Popular Ruby Editors: To write your Ruby programs you will need an editor: If you are working on Windows machine then you can use any simple text editor like Notepad or Edit plus. VIM (Vi IMproved) is very simple text editor. This is available on almost all Unix machines and now Windows as well. Otherwise your can use your favorite vi editor to write Ruby programs. RubyWin is a Ruby Integrated Development Environment (IDE) for Windows. Ruby Development Environment (RDE) is also very good IDE for windows users. Interactive Ruby (IRb): Interactive Ruby (IRb) provides a shell for experimentation. Within the IRb shell, you can immediately view expression results, line by line. This tool comes along with Ruby installation so you have nothing to do extra to have IRb working. Just type irb at your command prompt and an Interactive Ruby Session will start as given below: $irb irb 0.6.1(99/09/16) irb(main):001:0> def hello irb(main):002:1> out = "Hello World" irb(main):003:1> puts out irb(main):004:1> end nil irb(main):005:0> hello Hello World nil irb(main):006:0> Do not worry about what I did here. You will learn about all these steps in subsequent chapters. What is Next?
  • 2. I assume now you have a working Ruby Environment and you are ready to write first Ruby Programs. Next chapter will teach you how to write Ruby programs.