rubygem-nokogiri error: "\xE2" from ASCII-8BIT to UTF-8

Adam Strohl adams-freebsd at
Thu Jun 13 19:03:43 UTC 2013

On 6/14/2013 1:10, Steve Wills wrote:
>> Hello,
>> I just attempted to upgrade Ruby & Redmine and one of the gems,
>> nokogiri, (and a few others) die with the same "ASCII-8BIT to UTF-8"
>> error durring the doc install phase which prevents the port from
>> completing the install.
>> I've searched and search and cannot find anything that relates to this
>> specifically, anyone have any ideas?
> I've seen errors like this, although not with this specific port. I
> haven't come up with a good solution yet, but often setting LC_LANG or
> LANG or LC_ALL to en_us.utf-8 (or whatever is appropriate for you) helps.
> FWIW, sets LC_CTYPE=UTF-8, but maybe it needs to set more. The
> problem is it's generating docs and needs this, but we don't set a LANG by
> default.

BINGO.  Thank you both Michael Gmelin (who replied privately) and Steve.

My defaults were C or blank when I ran "locale", and per both of your 
suggestions setting this let nokogiri build:

export LANG="en_US.UTF-8"; export LC_ALL="en_US.UTF-8";


Building native extensions.  This could take a while...
Successfully installed nokogiri-1.5.0
1 gem installed
Installing RDoc documentation for nokogiri-1.5.0...
===>   Registering installation for rubygem-nokogiri-1.5.0

I also want to note (in case anyone else searches for this) that 
rubygem-net-ldap port also had the same issue for me and this fixed that 
port as well.

Thanks again!

Adam Strohl

More information about the freebsd-ports mailing list