addis_a
September 5, 2014, 9:55am
1
Hi folks,
did someone of you experience this as well?
$ uname -a
CYGWIN_NT-6.1 arnie 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin
$ ruby --version
ruby 2.0.0p481 (2014-05-08) [x86_64-cygwin]
$ gem --version
2.4.1
$ gem list -l
*** LOCAL GEMS ***
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.5)
rake (10.3.2)
rdoc (4.1.1)
$ gem update
Updating installed gems
ERROR: While executing gem … (ArgumentError)
invalid byte sequence in UTF-8
$ locale
LANG=en_US.UTF-8
LC_CTYPE=“en_US.UTF-8”
LC_NUMERIC=“en_US.UTF-8”
LC_TIME=“en_US.UTF-8”
LC_COLLATE=“en_US.UTF-8”
LC_MONETARY=“en_US.UTF-8”
LC_MESSAGES=“en_US.UTF-8”
LC_ALL=
$ LANG=C gem update
Updating installed gems
ERROR: While executing gem … (ArgumentError)
invalid byte sequence in US-ASCII
Apparently when reading a file the environment’s encoding information
is applied. I’m just not sure whether this is an issue with gem
command or a Cygwin adjustment to that.
Bonus points for a solution.
Kind regards
robert
robkuz
September 5, 2014, 10:12am
2
On Sep 5, 2014, at 0:54, Robert K. [email protected]
wrote:
$ LANG=C gem update
Updating installed gems
ERROR: While executing gem … (ArgumentError)
invalid byte sequence in US-ASCII
Apparently when reading a file the environment’s encoding information
is applied. I’m just not sure whether this is an issue with gem
command or a Cygwin adjustment to that.
Hrm… do you have a ~/.gemrc?
Otherwise, try something like:
ruby -E US-ASCII -S gem update --system
robkuz
September 5, 2014, 12:00pm
3
On Fri, Sep 5, 2014 at 10:12 AM, Ryan D. [email protected]
wrote:
command or a Cygwin adjustment to that.
Hrm… do you have a ~/.gemrc?
No. I had a directory ~/.gem. But moving that away does not make a
difference.
Otherwise, try something like:
ruby -E US-ASCII -S gem update --system
I don’t expect that this will make a difference - and, yes:
$ ruby -E US-ASCII -S gem update
Updating installed gems
ERROR: While executing gem … (ArgumentError)
invalid byte sequence in UTF-8
Setting LANG in the environment is even more effective as you can see
on the error message:
$ LANG=C ruby -S gem update
Updating installed gems
ERROR: While executing gem … (ArgumentError)
invalid byte sequence in US-ASCII
If only the file read was mentioned… Oh wait, I have a solution:
$ LANG=C.BINARY ruby -S gem update
Updating installed gems
Updating minitest
Fetching: minitest-5.4.1.gem (100%)
Successfully installed minitest-5.4.1
Parsing documentation for minitest-5.4.1
Installing ri documentation for minitest-5.4.1
Installing darkfish documentation for minitest-5.4.1
Done installing documentation for minitest after 3 seconds
Parsing documentation for minitest-5.4.1
Done installing documentation for minitest after 0 seconds
Gems updated: minitest
“LANG=C.BINARY gem update” works, too.
Thank you, Ryan!
Kind regards
robert