RUser98 RUser98 - 1 month ago 84
Linux Question

Metasploit Update: Error In Bundle Install ( nokogiri 1.6.8 )

Metasploit was working fine until this morning when I updated it with

, then all went to heck.

Now gives me this error:

Could not find nokogiri-1.6.8 in any of the sources
Run bundle install to install missing gems.

I went and typed
bundle install
. It was going fine until this happened:

Installing nokogiri 1.6.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.2 -r ./siteconf20160831-24032-1wim46x.rb extconf.rb --use-system-libraries
Using pkg-config version 1.1.7
checking if the C compiler accepts ... yes
Building nokogiri using system libraries.
checking for libxml-2.0... no
checking for libxslt... no
checking for libexslt... no
ERROR: cannot discover where libxml2 is located on your system. please make sure pkg-config is installed.
* 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:

extconf failed, exit code 1

Gem files will remain installed in /usr/share/metasploit-framework/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.8 for inspection.
Results logged to /usr/share/metasploit-framework/vendor/bundle/ruby/2.2.0/extensions/x86-linux/2.2.0/nokogiri-1.6.8/gem_make.out
Using rack-test 0.6.3
Using faraday 0.9.2
Using jsobfu 0.4.1
Using packetfu 1.1.11
Using rex-arch 0.1.1
Using rex-ole 0.1.2
Using rex-random_identifier 0.1.0
Using rex-zip 0.1.0
Using simplecov 0.12.0
Using activesupport
Using tzinfo-data 1.2016.6
An error occurred while installing nokogiri (1.6.8), and Bundler cannot
Make sure that gem install nokogiri -v '1.6.8' succeeds before bundling.

I started searching and came across this, which suggested that I should run
bundle config build.nokogiri --use-system-libraries

But again, nothing. I also tried
gem install nokogiri -v 1.6.8
. I also tried even older versions:
gem install nokogiri -v 1.6.0

I'm using Kali.

EDIT: I think the solution is that I should reinstall Kali; One thing i learned from all this is to NEVER update MSF :D


@RUser98 --

I found this answer on the Unix Stack Exchange site maybe it will help you?

If you get a error installing nokogiri-1.6.8 try to:

sudo apt-get install libxslt-dev libxml2-dev zlib1g-dev --yes 


I've also had numerous issues with installing/updating Metasploit on Kali each time something new so I feel your pain