In cmdline.rb file:
puts ARGV[0]
puts "Enter a no "
val =gets.chomp.to_i()
Come to command prompt
Go to taht file path>cmdline.rb prasad
cmdline.rb:15:ingets
:no such file or directory-prasad(Errorno::ENOENT)
from cmdline.rb
In cmdline.rb file:
puts ARGV[0]
puts "Enter a no "
val =gets.chomp.to_i()
Come to command prompt
Go to taht file path>cmdline.rb prasad
cmdline.rb:15:ingets
:no such file or directory-prasad(Errorno::ENOENT)
from cmdline.rb
the regular “gets” opens & reads ARGV[0], if given. Use $stdin.gets
instead.
thank you very much Niklas Cathor,it is very useful to me
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs