Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Installing Ruby

ruby

  • Please log in to reply
1 reply to this topic

#1 mr mike

mr mike

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 89 posts

Posted 05 January 2011 - 08:35 PM

The purpose of this tutorial is straight forward, and the most important, install ruby on your system. Lets begin our journey into learning a fun language.

WINDOWS- The hardest, but not really

First download the ruby installer...
Second install...
Third, you now have a couple things after the install...

1. Use the tools in the start menu folder:

a. click ruby
b. use interactive ruby
type:
puts "Welcome to the World of Ruby"

displays:
Welcome to the World of Ruby
=> nil

or

a. open ruby with command prompt
b. use txt editor and start coding(I use notepad++)
just type:
puts "Welcome to the World of Ruby"
save as welcome.rb
c. run your .rb file
C:\"path"\> ruby welcome.rb

2. Set your class path to run from command prompt if not recognized initially
a. Long way

- search: view advanced system settings and select

- click environment variables

- Check PATHEXT has the following %PATHE%;.RB;.RBW
if this is not there edit it
enter: %PATHEXT%;.RB;.RBW

- edit Path
enter: C:\Ruby192\bin

note: C:\Rubyxxx\bin where xxx is the version ie. if 1.8
C:\Ruby18\bin (to know which version open your C:\ folder
the folder to enter will be there

Now you can open command prompt and type irb for interactive ruby or run a .rb file by using
the command ruby "file".rb
... time to play!

LINUX is even simpler

Fedora example
yum install ruby(version)-full
yum install ruby-full

Now open your command prompt and type:
irb or ruby "file".rb
... time to play!

Take a look at the other three tutorials for an idea of the language. The api can be found here.

Also, thanks to Roger and the rest of codecall.net for the addition of this section.
  • 3

#2 John

John

    CC Mentor

  • Moderator
  • 4450 posts
  • Location:New York, NY

Posted 06 January 2011 - 05:52 PM

Mr Mike, thanks for the ruby tutorials. I'm sure they will be a great addition.
  • 0





Also tagged with one or more of these keywords: ruby

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download