"alert" is not working

Hi.I tried to make a simple app like showing a window that says:Good
morning!
And I tried this code:
alert “Good morning”
But it isn’t working when I try to run it in CMD(going in CMD and throw
it in the CMD window). It just says:
C:/Documents and Settings/radu/Desktop/goodmorning.rb:1:in <main>': undefined methodalert’ for main:Object (NoMethodError)

And when I put the code in Hackety Hack and RubyKids it is working

That’s because plain ruby doesn’t have an “alert” method. For normal
ruby, try this:

puts "Good morning"

Brian C. wrote in post #1084118:

That’s because plain ruby doesn’t have an “alert” method. For normal
ruby, try this:

puts "Good morning"

Ok…Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs