On Fri, Sep 5, 2014 at 10:12 AM, Ryan Davis <ryand-ruby / zenspider.com> wrote:
>
> On Sep 5, 2014, at 0:54, Robert Klemme <shortcutter / googlemail.com> 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?

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


-- 
[guy, jim].each {|him| remember.him do |as, often| as.you_can - without end}
http://blog.rubybestpractices.com/