ruby beginner, get.chomp.to_i does not read.
$ ruby index.rb class.rb
# index.rb
require "./class"
count = get.chomp.to_i
puts count
When I execute, 0 is automatically entered in the count where count = get.chomp.to_i
.
The execution method was different. Since it is written as require" / menu "
,
$ ruby index.rb
It was OK only. It read it properly.
Recommended Posts