Closed ahmadawais closed 8 years ago
I'd try to install nokogiri manually using either
gem install nokogiri -- --use-system-libraries
or
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
If neither of those work, make sure your xcode is up to date and you have developer tools installed. Then I'd use homebrew to install the dependencies and update bundler to use those libraries by default.
@codenamev Thanks for the help. Here's what I tried.
First of all I tried.
gem install nokogiri -- --use-system-libraries
And it gave me the following error
sudo gem install nokogiri -- --use-system-libraries
Password:
Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.7.2/ext/nokogiri
/usr/local/opt/ruby/bin/ruby -r ./siteconf20160528-27156-1tj6om9.rb extconf.rb --use-system-libraries
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/Cellar/ruby/2.3.1/bin/$(RUBY_BASE_NAME)
--help
--clean
--use-system-libraries
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-pkg-config
--without-pkg-config
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-libxslt-config
--without-libxslt-config
--with-pkg-config
--without-pkg-config
--with-exslt-dir
--without-exslt-dir
--with-exslt-include
--without-exslt-include=${exslt-dir}/include
--with-exslt-lib
--without-exslt-lib=${exslt-dir}/lib
--with-libexslt-config
--without-libexslt-config
--with-pkg-config
--without-pkg-config
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0/nokogiri-1.6.7.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0/nokogiri-1.6.7.2/gem_make.out
Then I tried
and it seems that it went all OK and the GEM was installed.
sudo 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
Building native extensions with: '--with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries'
This could take a while...
Successfully installed nokogiri-1.6.7.2
Parsing documentation for nokogiri-1.6.7.2
Installing ri documentation for nokogiri-1.6.7.2
Done installing documentation for nokogiri after 4 seconds
1 gem installed
And after that I ran the original command and it installed everything as it was supposed to.
sudo gem install git_reflow
Fetching: multi_json-1.12.1.gem (100%)
Successfully installed multi_json-1.12.1
Fetching: hashie-3.4.4.gem (100%)
Successfully installed hashie-3.4.4
Fetching: multipart-post-2.0.0.gem (100%)
Successfully installed multipart-post-2.0.0
Fetching: faraday-0.9.2.gem (100%)
Successfully installed faraday-0.9.2
Fetching: faraday_middleware-0.9.2.gem (100%)
Successfully installed faraday_middleware-0.9.2
Fetching: reenhanced_bitbucket_api-0.3.2.gem (100%)
Successfully installed reenhanced_bitbucket_api-0.3.2
Fetching: httpclient-2.8.0.gem (100%)
Successfully installed httpclient-2.8.0
Fetching: highline-1.7.8.gem (100%)
Successfully installed highline-1.7.8
Fetching: gli-2.14.0.gem (100%)
Successfully installed gli-2.14.0
Fetching: rack-1.6.4.gem (100%)
Successfully installed rack-1.6.4
Fetching: multi_xml-0.5.5.gem (100%)
Successfully installed multi_xml-0.5.5
Fetching: jwt-1.5.1.gem (100%)
Successfully installed jwt-1.5.1
Fetching: oauth2-1.1.0.gem (100%)
Successfully installed oauth2-1.1.0
Fetching: thread_safe-0.3.5.gem (100%)
Successfully installed thread_safe-0.3.5
Fetching: descendants_tracker-0.0.4.gem (100%)
Successfully installed descendants_tracker-0.0.4
Fetching: addressable-2.4.0.gem (100%)
Successfully installed addressable-2.4.0
Fetching: github_api-0.14.0.gem (100%)
Successfully installed github_api-0.14.0
Fetching: colorize-0.7.7.gem (100%)
Successfully installed colorize-0.7.7
Fetching: git_reflow-0.8.1.gem (100%)
You need to setup your GitHub OAuth token
Please run 'git-reflow setup'
Successfully installed git_reflow-0.8.1
Parsing documentation for multi_json-1.12.1
Installing ri documentation for multi_json-1.12.1
Parsing documentation for hashie-3.4.4
Installing ri documentation for hashie-3.4.4
invalid options: -SHN
(invalid options are ignored)
Parsing documentation for multipart-post-2.0.0
Installing ri documentation for multipart-post-2.0.0
Parsing documentation for faraday-0.9.2
Installing ri documentation for faraday-0.9.2
Parsing documentation for faraday_middleware-0.9.2
Installing ri documentation for faraday_middleware-0.9.2
Parsing documentation for reenhanced_bitbucket_api-0.3.2
Installing ri documentation for reenhanced_bitbucket_api-0.3.2
Parsing documentation for httpclient-2.8.0
Installing ri documentation for httpclient-2.8.0
Parsing documentation for highline-1.7.8
Installing ri documentation for highline-1.7.8
Parsing documentation for gli-2.14.0
Installing ri documentation for gli-2.14.0
Parsing documentation for rack-1.6.4
Installing ri documentation for rack-1.6.4
Parsing documentation for multi_xml-0.5.5
Installing ri documentation for multi_xml-0.5.5
Parsing documentation for jwt-1.5.1
Installing ri documentation for jwt-1.5.1
Parsing documentation for oauth2-1.1.0
Installing ri documentation for oauth2-1.1.0
Parsing documentation for thread_safe-0.3.5
Installing ri documentation for thread_safe-0.3.5
Parsing documentation for descendants_tracker-0.0.4
Installing ri documentation for descendants_tracker-0.0.4
Parsing documentation for addressable-2.4.0
Installing ri documentation for addressable-2.4.0
Parsing documentation for github_api-0.14.0
Installing ri documentation for github_api-0.14.0
Parsing documentation for colorize-0.7.7
Installing ri documentation for colorize-0.7.7
invalid options: -ri
(invalid options are ignored)
Parsing documentation for git_reflow-0.8.1
Installing ri documentation for git_reflow-0.8.1
Done installing documentation for multi_json, hashie, multipart-post, faraday, faraday_middleware, reenhanced_bitbucket_api, httpclient, highline, gli, rack, multi_xml, jwt, oauth2, thread_safe, descendants_tracker, addressable, github_api, colorize, git_reflow after 24 seconds
19 gems installed
Thanks for the help.
Fantastic! Thanks for providing feedback for anyone else running into this issue :smile:
^ That was the intention of my last comment. I edited the issue title for it to rank at Google in case someone is searching via Google for a similar issue.
gem uninstall nokogiri xcode-select --install gem install nokogiri
upgrade to osx sierra broke xcode cli reinstall fixed it
Thank you, @ahmadawais. It worked for me as well.
I'm on Sierra, 10.12.6
sudo 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
@ahmadawais Thanks for sharing. This worked for me (just updated the version of the MacOSX sdk):
sudo gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2 --use-system-libraries
Thanks again 😄
FWIW (for those coming in from a web search),
xcode-select --install
would not return any information as I have installed it previously so I assumed that this step was fine but after inspecting the mkmf.log
file it had a message in there that I still have to, again (because I did it before), agree to the CLI tools (im guessing because I just updated the cli tools via app store.app
).
inside of mkmf.log
:
Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.
🤣 Thanks OS X
after which I was able to install successfully.
@codenamev Thanks!
For me it turned out cool, I just had to change the path to SDK of XCODE which in my case I use 10.12
$ gem install nokogiri - --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms / MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 --use-system-libraries
sudo gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2 --use-system-libraries
@ahmadawais Thank you very much!
Those coming here from google after upgrading MacOS to Mojave (10.14), just changing the above paths to 10.14 didn't address the root issue. See this stack overflow answer.
Running this resolved it for me:
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
I have to kill all bundler services to make it work for bundle install
only without manually installing nokogiri. Sometimes activesupport depends on nokogiri and it could be broken with existing symlinks
For Mojave this one also works (remember to change the SDK version):
gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 --use-system-libraries
With bundler when trying to install to vendor/bundle, I've followed this method:
bundle config build.nokogiri --use-system-libraries --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2
bundle install --path vendor/bundle
gem uninstall nokogiri xcode-select --install gem install nokogiri
upgrade to osx sierra broke xcode cli reinstall fixed it
It works for me! Thanks bro
sudo gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/libxml2/ --use-system-libraries
Esto funciono para mi
sudo gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2 --use-system-libraries
I have been looking forward to using GitReflow and today I ended up installing it. I think I had some issues which are listed below since the gem was not installed. Can you guide me how to get it done?