Nokogiri: Failed to install nokogiri with native extensions...

Created on 25 Mar 2017  路  6Comments  路  Source: sparklemotion/nokogiri

If you're having trouble installing Nokogiri ...

Have you tried following the installation tutorial?

Yes.

What is the output of gem install?

screen shot 2017-03-25 at 4 35 21 pm
screen shot 2017-03-25 at 4 35 41 pm
screen shot 2017-03-25 at 4 35 46 pm

What are the contents of the mkmf.log file?

Check out this gist.

What operating system are you using?

Mac OS Sierra - 10.12.3

If this isn't an installation issue ...

What problems are you experiencing?

Nokogiri is failing to install native extensions in my rails projects.

What's the output from nokogiri -v?

The output can be found at this gist.

Can you provide a self-contained script that reproduces what you're seeing?

I simply ran rails new project -d postgresql on both Ruby 2.3.3 and 2.4.0 with Rails 5.0.2. Both outputs were the exact same for the different Ruby versions.

EDIT

I am able to create a new rails application, cd into it, and run bundle to with success. But that's not the ideal situation. Also, it's hit or miss. That method only worked once and I've tried about 4 other times, both in 2.3.3 and 2.4.0. The version it did work in was 2.3.3 but there were 2 other cases where that method did not work. Just wanted to throw that out there.

platforosx

Most helpful comment

brew install libxml2

bundle config build.nokogiri --use-system-libraries \

--with-xml2-include=$(brew --prefix libxml2)/include/libxml2

bundle install

All 6 comments

Same here.

I am also seeing a similar error when attempting to bundle 1.7.1

@iamclaytonray Thanks for opening this issue, hopefully we can get you up and running.

In your original description, you indicated you had followed the installation tutorial. The error message you've posted (btw, we prefer text and not screenshots, for future reference) indicates that the issue may be the one covered in the tutorial's "Troubleshooting MSX Installation" section, entitled, "Error Message About Undeclared Identifier LZMA_OK".

Can you please double-check that the advice in that tutorial does not fix your symptoms?

brew install libxml2

bundle config build.nokogiri --use-system-libraries \

--with-xml2-include=$(brew --prefix libxml2)/include/libxml2

bundle install

I'm going to close this ticket in two days, unless I hear back from the OP that the tutorial does not cover this case.

Closing, as I'm confident the tutorial addresses this case.

Was this page helpful?
0 / 5 - 0 ratings