I am using:
- ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32]
- Notepad ++
- PowerShell v. 1.0 on Windows
When I run the code below in PowerShell:
first, second, third = ARGV
puts "Your first variable is: #{first}"
puts "Your second variable is: #{second}"
puts "Your third variable is: #{third}"
I get:
Your first variable is:
Your second variable is:
Your third variable is:
I've tried copying the code from the next exercises with ARGV and I'm getting the same error.
I would love to go forward, but if its not working i will be stuck in this book or the next one. Thank you for your time!
I think your problem is that you did NOT give the script arguments in your command line call. The whole point of ARGV is to call the script with parameters in the command line such that the script can use the parameters. You can find more infos about ARGV here : What's the point of ARGV in Ruby?
When running in ubuntu I get a good result :
So, my solution is in powershell to execute the script with arguments (because otherwise they are empty, giving the result you had) :
For info, my Ubuntu version (where your script works perfectly) is :