Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've seen Guard and it's usefulness in web development and would like to install it. Naturally, I expected to be able to use sudo gem install guard to do so (yes, it is a Ruby Gem). However the installation errors out. Here is what I'm getting:

Building native extensions.  This could take a while...
ERROR:  Error installing guard:
    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:4:in `<main>'

Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ffi-1.9.3/ext/ffi_c/gem_make.out

Does anyone know how I can fix this? Thanks for any help.

share|improve this question
up vote 4 down vote accepted

I figured out my problem. After looking at the error, I realised the problem was that mkmf was not installed. To fix this, I ran the command, sudo apt-get install ruby1.9.1-dev. After that, everything worked like a charm.

share|improve this answer

Download Guard via Mozilla and then install. Option 2. Try to update again sudo apt-get update Then sudo apt-gem-update Then try sudo gem-get install guard ( or sudo gem install guard )

share|improve this answer
Where is the Mozilla download? The second option didn't work. – Dillmo Nov 10 '13 at 13:30
I'm glad you. Found your answer! It means 'apt-get install moza-ruby' moza is Mozilla Firefox download – Austin Nov 10 '13 at 17:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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