I tried in Ubuntu 14.04.2 LTS and working fine

Step 1: (the purpose of the first line in designating which interpreter to use for the rest of the file)

#!/usr/bin/env ruby
puts "Hello World!"

Step 2: (make the file executable with below command)

chmod u+x hello-world.rb

Step 3:


Please not that If your platform doesn't support the #!/usr/...

Posted on October 26, 2015 by Amit Pandya in Ruby, Ubuntu