Jump to content

Getting Started with Ruby

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Jhost

Jhost

    Newbie

  • Members
  • PipPip
  • 11 posts
Hello I am teaching the very basic and classic Hello World program for Ruby. I notice there isn't much content in this forum so I may as well start very basic and try to contribute some programming here. This is for those who would like to see some Ruby code and understand the very basics of it. If you are experienced please don't tell me that this thread useless because some people want to see Ruby and learn the absolute basics.

Before trying to develop Ruby you must download it Download Ruby. After you download it open up the IRB. This can be accessed in the Start Menu folder as "Interactive Ruby"

Now you will see it says
irb(main):001:0>

Now do not simply type "Hello World", even though it will output the Hello World it isn't outputting it, it's just saying the result of what we gave it, so it isn't really printing Hello World.

Now type
puts "Hello World"



This is the classic Hello World program in Ruby, it is extremely short and simple. The keyword "puts" tells Ruby to print out the next part of the code in quotation marks. The "=> nil" is the result of the expression, which is Ruby's nothing. This is the most basic program in Ruby.

Again this is a tutorial for those who are interested in seeing what Ruby looks like or want to begin learning to code it. If this tutorial helped you please let me know, and if you don't like it please don't post unless giving constructive criticism.
Posted Image
Posted Image

#2
isuru

isuru

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 233 posts
Downloaded Ruby executable .exe installation file and installed Ruby. And Hello World program work.
Thanks For The Tutorial!
And looking forward to next tutorial.

#3
Jhost

Jhost

    Newbie

  • Members
  • PipPip
  • 11 posts

isuru said:

Downloaded Ruby executable .exe installation file and installed Ruby. And Hello World program work.
Thanks For The Tutorial!
And looking forward to next tutorial.

I am glad it helped! Ruby is a great language and should be more popular
Posted Image
Posted Image

#4
azad007

azad007

    Newbie

  • Members
  • Pip
  • 5 posts
Thanks for the tutorial.Ruby would be popular language in no time .