Michael Durrant
Michael Durrant

Reputation: 96544

Fix for "Nokogiri failed to build gem native extension"

The command on my Mac

$ gem install nokogiri -v '1.7.1'

gives the error

Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

I tried using

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

but it didn't help, I get the same error

Upvotes: 2

Views: 851

Answers (1)

Michael Durrant
Michael Durrant

Reputation: 96544

The fix was to use

xcode-select --install

and accept the GUI prompt that comes up about developer options.

Then the gem install and bundle commands worked.

Upvotes: 2

Related Questions