How do I create a ruby Hello world?

If you are talking about a command line program this will work.

puts "Hello World"

or if you want an object oriented version

class HelloWorld
   def initialize(name)
      @name = name.capitalize
   end
   def sayHi
      puts "Hello #{@name}!"
   end
end

hello = HelloWorld.new("World")
hello.sayHi

If you are looking for a ruby on rails version of Hello World.
Check the Getting Started Guide for Rails.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)