Hi all - following the exercises but keep getting an error when I try and combine the ARGV and gets.chomp the code and result are here:
first, second, third = ARGV # after we type the name of the programme we must then provide the three variables
puts “your first variable is #{first}”
puts “Your second variable is #{second}”
puts “Your third variable is #{third}”
puts “Give me another fruit”
fruit = gets.chomp
puts “and the last fruit is #{fruit}”
PS C:\Users\Study\documents\ruby> ruby ex13.rb oranges apples bananas
your first variable is oranges
Your second variable is apples
Your third variable is bananas
Give me another fruit
Traceback (most recent call last):
2: from ex13.rb:11:in <main>' 1: from ex13.rb:11:in
gets’
ex13.rb:11:in `gets’: No such file or directory @ rb_sysopen - oranges (Errno::ENOENT)
What am I doing wrong?