Linux Basics H7 – Using Ruby and Python on Linux

By Emrah Okic

In the final homework report of Linux Basics course I will try two programming languages in Linux. I chose two programming languages that I have not tried before. I will setup the environment for them and try to do the easiest task, print Hello World!

Ruby

To setup environment for Ruby, the Ruby package has to be installed from resources.

emrah@chicos-virtual-linux:/$ sudo apt-get install ruby-full

Now we have Ruby platform ready and we can test it.

To access ruby in terminal, all we have to do is type “ruby”. To print “Hello World!”, just typing the ruby line: puts “Hello World!” does the trick. to exit ruby press Ctrl-D. Below is the result.

ruby.png

Python

Unlike Ruby, Python is pre-installed in Linux. No need for installing anything to access it. Just typing “python” opens Python platform. To get Hello World! typing print “Hello World!” does it. Below are the results.

python

 

Leave a comment