Ruby Programming - 2 - Sabra Seekers

Sabra Seekers

“Write what you know. That should leave you with a lot of free time.”

Hot

Post Top Ad

Friday, July 14, 2017

Ruby Programming - 2

අද අපි කතා කරමු, Windows වල කොහොමද RUBY  Programming කරන්නෙ කියලා.


මුලින්ම ruby ඔයාලගේ computer එකට download කරගෙන install කරගන්න ඕනේ.

ඔයාලට Ruby වල  නවතම version එක  (Ruby 2.4.1) පහත link වලින්  download කර ගන්න පුළුවන්.

windows සඳහා  :- https://rubyinstaller.org/

Linux/ubuntu සඳහා  :- http://linux.softpedia.com/get/Programming/Interpreters/Ruby-1181.shtml


Sublime text, notepad, notepad++ වගේ Text Editor එකක් Useකරලා ඔයාලට ruby එක්ක වැඩ කරන්න පුලුවන්.







1) Text Editor එකේ puts ("hello world!") කියලා type කරගන්න.



   
2)  ඔයාලගේ programming එක “hello.rb"කියලා save කරගන්න ඕනේ. Ruby වලදී file extension එක .rb කියලා Use කරන්න අමතක කරන්න එපා.

3) Ruby Programming වලට අදාළ Command Prompt එක Open කරගන්න.

 All Apps > Ruby > Start Command Prompt with Ruby

  

4) ඔයාලගේ programming එක Desktop එකේ new folder එකක save කලා කියලා හිතමු.

Ø  cd desktop
Ø  cd new folder
Ø  කියලා ruby save කරපු folder එකට path එක හදාගන්න.




5) Command Prompt එකේ ruby hello.rb කියලා type කරගෙන එක Enter press කරන්න.

                                             

"hello world!" ඔයාලට දැක ගන්න පුලුවන්. 

1 comment:

Share on Google+

Post Top Ad