Question

I tried to add the unicorn gem to my gem file and when I run bundle install I get the following error:

Installing kgio (2.8.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb 
checking for CLOCK_MONOTONIC in time.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:686:in `macro_defined?'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:822:in `block in have_macro'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
        from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:821:in `have_macro'
        from extconf.rb:5:in `<main>'


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/kgio-2.8.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/kgio-2.8.1/ext/kgio/gem_make.out
An error occurred while installing kgio (2.8.1), and Bundler cannot continue.
Make sure that `gem install kgio -v '2.8.1'` succeeds before bundling.

Prior to including the unicorn gem I have no problems running bundle install. It appears to be failing while trying to install kgio 2.8.1. I've searched for solutions on Stackoverflow and elsewhere, the most common solution appears to be to install the Xcode development tools. I've done this and it has not resolved the issue.

I'm running Mac OSX 10.9.1 Mavericks with Ruby 1.9.3p392. Really need to get this resolved, any help would be very much appreciated.

Was it helpful?

Solution

I updated to Ruby 2.1 and the problem was resolved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top