Gem update: unable to convert “\xE7” to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII

后端 未结 4 1987
醉梦人生
醉梦人生 2020-12-12 14:01

just ran gem update on a light use server machine that hadn\'t been updated in a while... and am getting loads of \'unable to convert \"\\x??\" to UTF-8 in conv

相关标签:
4条回答
  • 2020-12-12 14:30

    I have had a similar issue on my Mac OS X using iTerm2 instead of the default OS X Terminal.app. The LC_CTYPE is not set properly by iTerm2, once I have added export LC_CTYPE="utf-8" to ~/.bash_profile the gem installation goes smoothly.

    note: of course you can add the export to any of the other profile files

    0 讨论(0)
  • 2020-12-12 14:32

    I was getting this same issue w/ installing another gem and didn't know how to get around it even after adding export LC_CTYPE="utf-8" to my ~/.bash_profile. It wasn't until I ran sudo gem update after that was able to install the gem.

    Note that I wanted to contribute this to the original accepted answer, however not enough points yet. :( Nonetheless I hope this helps someone else.

    0 讨论(0)
  • 2020-12-12 14:37

    Try running locale in your SSH terminal. This problem just started popping up for me. When I do locale I get this:

    LANG=C
    LC_CTYPE="C"
    LC_NUMERIC="C"
    LC_TIME="C"
    LC_COLLATE="C"
    LC_MONETARY="C"
    LC_MESSAGES="C"
    LC_PAPER="C"
    LC_NAME="C"
    LC_ADDRESS="C"
    LC_TELEPHONE="C" 
    LC_MEASUREMENT="C"
    LC_IDENTIFICATION="C"
    LC_ALL=
    

    The only fix I know of is to type LANG=en_US.UTF-8 every time I login through SSH.

    0 讨论(0)
  • 2020-12-12 14:38

    The combination of Daniel and werm's answers worked for me, once I also unset LC_ALL. I ended up with this:

    export LC_CTYPE=en_US.UTF-8
    export LANG=en_US.UTF-8
    unset LC_ALL
    
    0 讨论(0)
提交回复
热议问题