I'm trying to install metasploit on my raspberry pi 3 B. But I have a gem that keeps failing. Here's the error I'm getting:

root@raspberrypi:/opt/metasploit-framework# gem install nokogiri -v '1.8.1'

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

current directory: /var/lib/gems/2.3.0/gems/nokogiri-1.8.1/ext/nokogiri

/usr/bin/ruby2.3 -r ./siteconf20171225-5790-o99pl4.rb extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/nokogiri-1.8.1 for inspection. Results logged to /var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/nokogiri-1.8.1/gem_make.out root@raspberrypi:/opt/metasploit-framework#

So I'm not really sure what to do. Any advice would be appreciated. Thanks!


1 Answer 1



sudo apt-get install build-essential patch ruby-dev zlib1g-dev


sudo gem install nokogiri -v '1.8.1' --source 'https://rubygems.org/'

Had the same problem with 1.8.2 on raspbian stretch.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.