Gets and ARGV?

  • Thread starter Kurtis Rainbolt-greene
  • Start date
K

Kurtis Rainbolt-greene

Code >

option = input[0]
values = input[1,input.length]

print '#Message: '
i = gets

Active >

thinkwritemute@thinkwritemute-netbook:~/Dropbox/Public/Repositories/ruby/twt$
ruby twt.rb post
#Message: twt.rb:181:in `gets': No such file or directory - post
(Errno::ENOENT)
from twt.rb:181:in `gets'
from twt.rb:181:in `<main>'
 
J

Justin Collins

Kurtis said:
Code >

option = input[0]
values = input[1,input.length]

print '#Message: '
i = gets

Active >

thinkwritemute@thinkwritemute-netbook:~/Dropbox/Public/Repositories/ruby/twt$
ruby twt.rb post
#Message: twt.rb:181:in `gets': No such file or directory - post
(Errno::ENOENT)
from twt.rb:181:in `gets'
from twt.rb:181:in `<main>'

If you wish to be certain to get input from stdin, use $stdin.gets

http://ruby-doc.org/core/classes/Kernel.html#M005955

-Justin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top