Nokogiri: Install on Mac OS 10.12.5 -- rvm and ruby ruby 2.4.0p0 faols

Created on 16 Jun 2017  路  2Comments  路  Source: sparklemotion/nokogiri

I have just reinstalled a gem (gpx) which depends on Nokogiri this appears to have pulled a newer version of nokogiri. This in turn bitched that the standard Mac OS ruby (2.0.0) was too old. I then installed rvm and ruby 2.4.0 and tried again.

Now nokogiri install dies trying to build libxml2:

Running 'compile' for libxml2 2.9.4... ERROR, review '/Users/rful011/.rvm/gems/ruby-2.4.0/gems/nokogiri-1.8.0/ext/nokogiri/tmp/x86_64-apple-darwin16.6.0/ports/libxml2/2.9.4/compile.log' to see what happened. Last lines are:

unsigned short* in = (unsigned short*) inb;
                     ^~~~~~~~~~~~~~~~~~~~~

encoding.c:815:27: warning: cast from 'unsigned char ' to 'unsigned short *' increases required alignment from 1 to 2 [-Wcast-align]
unsigned short
out = (unsigned short) outb;
^~~~~~
4 warnings generated.
CC error.lo
CC parserInternals.lo
CC parser.lo
CC tree.lo
CC hash.lo
CC list.lo
CC xmlIO.lo
xmlIO.c:1450:52: error: use of undeclared identifier 'LZMA_OK'
ret = (__libxml2_xzclose((xzFile) context) == LZMA_OK ) ? 0 : -1;
^
1 error generated.
make[2]:
[xmlIO.lo] Error 1
make[1]:
[all-recursive] Error 1
make: *
* [all] Error 2

Most helpful comment

Apologies for not doing due diligence :(
I see this is a know issue. For the record I reinstalled the command line tools and that appears to have fixed the problem.

xcode-select --install

All 2 comments

One more thing. The comand run was 'gem install nokogiri' with no options.

Apologies for not doing due diligence :(
I see this is a know issue. For the record I reinstalled the command line tools and that appears to have fixed the problem.

xcode-select --install

Was this page helpful?
0 / 5 - 0 ratings