4

I am trying to install rb-inotify with the following command

sudo gem install rb-inotify

and I got the following error

Building native extensions.  This could take a while...
ERROR:  Error installing rb-inotify:
    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.8.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ffi-1.8.1/ext/ffi_c/gem_make.out

any help would be appreciated, thanks

YTKColumba
  • 4,023
  • 4
  • 19
  • 21

2 Answers2

17

Install the ruby1.9.1-dev package first by running

sudo apt-get install ruby1.9.1-dev

from the terminal. Then install rb-inotify as you were trying before (possibly with the addition of the --version flag?)

sudo gem install --version '~>0.9' rb-inotify

I've followed this process to fix a warning from Sass, and it worked for me.

This comes from the other question linked in the comment by @shrikant1712. I'm merely typing it up here for easier access from this question.

Community
  • 1
  • 1
nickiaconis
  • 1,418
  • 12
  • 24
  • I tried this ad am still getting the error... Building native extensions. This could take a while... ERROR: Error installing rb-inotify: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb checking for ffi.h... no checking for ffi.h in /usr/local/include,/usr/include/ffi... no checking for rb_thread_blocking_region()... yes checking for rb_thread_call_with_gvl()... yes checking for rb_thread_call_without_gvl()... yes checking for ffi_prep_cif_var()... no creating extconf.h creating Makefile make sh: 1: make: not found – Daniel Tate Oct 21 '13 at 21:36
1

add into your gemfile as

gem "rb-inotify", "~> 0.9.0"

and bundle install

shrikant1712
  • 4,336
  • 1
  • 24
  • 42