2

I ran the following command and got a ``require': cannot load such file -- mkmf ` error message

$ sudo gem install sensu-plugin --no-rdoc --no-ri                                                                                

Fetching: json-1.8.2.gem (100%)

Building native extensions.  This could take a while...

ERROR:  Error installing sensu-plugin:

        ERROR: Failed to build gem native extension.



        /usr/bin/ruby1.9.1 extconf.rb

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)

        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

        from extconf.rb:1:in `<main>'

How can I fix it?

The OS is ubunut 14.04

Anthony Kong
  • 5,318

1 Answers1

3

In all currently supported version of Ubuntu (including Ubuntu 14.04), open the terminal and type:

sudo apt-get install ruby-dev  

This package contains the header files and the mkmf library, necessary to make an extension library for Ruby. It is also required to build many gems.

Source: https://stackoverflow.com/questions/27990898/sensu-windows-check-configuration/28058796#comment44517486_28058796

Allen
  • 327