Mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h


#1

My dradis installation on Kali Linux Rolling release fails:

~/dradis-ce# bundle install
Don’t run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this
machine.
Fetching gem metadata from https://rubygems.org/
Fetching additional metadata from https://rubygems.org/
Resolving dependencies…
Using rake 12.0.0

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby2.1 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.1.0/gems/RedCloth-4.3.1 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86-linux/2.1.0/RedCloth-4.3.1/gem_make.out
An error occurred while installing RedCloth (4.3.1), and Bundler cannot continue.
Make sure that gem install RedCloth -v '4.3.1' succeeds before bundling.

dpkg -l | grep ruby | grep dev shows me:

ii ruby-dev:i386 1:2.3.3 i386 Header files for compiling extension modules for Ruby (default version)
ii ruby1.8-dev 1.8.7.358-7 i386 Header files for compiling extension modules for the Ruby 1.8
ii ruby2.3-dev:i386 2.3.3-1 i386 Header files for compiling extension modules for the Ruby 2.3

Obviously. current versions of ruby do not install a ruby.h file in /usr/lib/ruby/include/. Has anyone got Dradis running on Kali Linux? If so, how?


#2

Hi @danielm, I’m Rachael with the Dradis support team. Yes, we’ve got many users running Dradis on Kali Linux (myself included!). Let’s get this sorted out. First, I want to confirm a few details. Did you install using the instructions in our guide here?

https://dradisframework.com/ce/documentation/install_kali.html

If you were using other instructions, let’s start with the guide above before moving on.

Otherwise, the latest version of dradis-ce is actually running Ruby v2.2 which isn’t listed in your output. Does apt-get install ruby2.2-dev resolve the error?


#3

Hi @rachkor
I followed the guide you mentioned.

Furthermore, apt-get update + apt-get install ruby2.2-dev says:
E: Unable to locate package ruby2.2-dev
E: Couldn’t find any package by glob 'ruby2.2-dev’
E: Couldn’t find any package by regex ‘ruby2.2-dev’

It is strange. apt-cache search libruby tells me that only version 2.1 and 2.3 are available.


#4

Solution:
apt-get remove ruby2.1
apt-get update
apt-get --reinstall install ruby2.1 (fails -> to old)

gem install bundler
-> reinstalled the bundler. Afterwards, it found ruby2.3.