Skip to content

Instantly share code, notes, and snippets.

@hgc81538
Last active August 29, 2015 14:06
Show Gist options
  • Save hgc81538/1566cabd816bb27bb254 to your computer and use it in GitHub Desktop.
Save hgc81538/1566cabd816bb27bb254 to your computer and use it in GitHub Desktop.
ERROR: While executing gem ... (ArgumentError) invalid byte sequence in UTF-8
In Windows environment, the error is occured when executing "gem install compass" in cygwin.
$ gem install compass
ERROR: While executing gem ... (ArgumentError)
invalid byte sequence in UTF-8
How to solve:
1) open C:\cygwin\usr\share\ruby\2.0.0\win32\registry.rb
(change to your version when necessary)
2) comment out line 172 and change "\r" to "\r\n" in line 173 (line numbers may vary)
from
----------------------
msg = msg[0, len].force_encoding(Encoding.find(Encoding.locale_charmap))
super msg.tr("\r", '').chomp
----------------------
to
----------------------
#msg = msg[0, len].force_encoding(Encoding.find(Encoding.locale_charmap))
super msg.tr("\r\n", '').chomp
----------------------
done.
Reference:
https://bugs.ruby-lang.org/issues/8508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment