Nokogiri: Nokogiri 1.6.8 shows up in gem list, but still fails on bundle install

Created on 28 Jul 2016  路  3Comments  路  Source: sparklemotion/nokogiri

Information

ruby: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
bundler: 1.12.5
gem version: 2.6.6
OS: El Capitan 10.11.6 (15G31)

When I run gem list I can see that nokogiri 1.6.8 is installed:

$ gem list

*** LOCAL GEMS ***

bigdecimal (default: 1.2.8)
did_you_mean (1.0.0)
io-console (default: 0.4.5)
json (default: 1.8.3)
mini_portile2 (2.1.0)
minitest (5.8.3)
net-telnet (0.1.1)
nokogiri (1.6.8)
pkg-config (1.1.7)
power_assert (0.2.6)
psych (default: 2.0.17)
rake (10.4.2)
rdoc (default: 4.2.1)
test-unit (3.1.5)

Running which gem gives me /usr/local/bin/gem. I did in fact find the nokogiri gem displayed below:

#!/usr/local/opt/ruby/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'nokogiri' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0.a"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

load Gem.activate_bin_path('nokogiri', 'nokogiri', version)

Having said all of that I still see an error onbundle install. Specifically Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/nokogiri-1.6.8/gem_make.out An error occurred while installing nokogiri (1.6.8), and Bundler cannot continue. Make sure thatgem install nokogiri -v '1.6.8'succeeds before bundling.

So running gem install nokogiri -v '1.6.8' throws a permissions error again. sudo gem install nokogiri -v '1.6.8' works, but doesn't resolve the issue. I did find https://github.com/sparklemotion/nokogiri/issues/1445 and ran into the follow:

$ xcode-select --install
$ xcode-select: error: command line tools are already installed, use "Software Update" to install updates

My software is up to date. Any help resolving this issue is greatly appreciated.

Update:
I also found this issue https://github.com/sparklemotion/nokogiri/issues/1486 and tried gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries but no luck in solving the issue. I also tried brew install coreutils as that seems to have worked for a few others, but again, no luck.

Most helpful comment

sure this is not a nokogiri problem? i have been struggling for the last hours and it seems that regardless of the environment, the one thing that fails is the nokogiri installation. even after running sudo gem install nokogiri -v '1.6.8' successfully, bundle install attempt to install it again, and fails again. no other gem seems to have similar issues.

All 3 comments

Hi i have the same issue here.

ruby: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
bundler: Bundler version 1.11.2
gem : 2.5.1
OS: OS X El Capitan 10.11.6 (15G1004)

I also see when i run gem list nokogiri

I get exactly the same error message as you got.

Sorry you're having issues, but this doesn't look like a nokogiri problem, this appears to be a permissions problem. You may want to try 'sudo' installing your gems, else I recommend asking on a general ruby mailing list.

sure this is not a nokogiri problem? i have been struggling for the last hours and it seems that regardless of the environment, the one thing that fails is the nokogiri installation. even after running sudo gem install nokogiri -v '1.6.8' successfully, bundle install attempt to install it again, and fails again. no other gem seems to have similar issues.

Was this page helpful?
0 / 5 - 0 ratings