This article introduces the solution for the " ===': invalid byte sequence in Windows-31J (ArgumentError)" error in the Ruby programming language.
It should be resolved by one of the following methods.
Add the following to the file.
Encoding.default_external = 'UTF-8'
Or add the following.
File.open(file, "r:utf-8") do |f|
Or specify options during execution.
$ ruby -Eutf-8 foo.rb