1

I'm trying to install Ultrahook on Mac OSX 10.10.5

I updated ruby first, then ran sudo gem install ultrahook but I just get an error: Failed to build gem native extension.

What does this mean and how do I get the install to work? Here's the full error output in terminal.

Richs-MBP:DESIGN rich$ sudo gem install ultrahook
Building native extensions.  This could take a while...
ERROR:  Error installing ultrahook:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20151013-1186-1p86dfm.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
         ^
1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.3 for inspection.
Results logged to /Library/
CaribouCode
  • 13,998
  • 28
  • 102
  • 174

2 Answers2

2

Even though I had the latest update for xCode (through the App Store), it turned out the issue here was with xCode. I solved the problem by first running:

xcode-select --install

Then after that install process was complete, I ran sudo gem install ultrahook which worked.

I found this answer in comments of an answer here: Failed to build gem native extension (installing Compass)

Community
  • 1
  • 1
CaribouCode
  • 13,998
  • 28
  • 102
  • 174
0

You are missing the link to config.h, fix it by create symlink:

#Create symbolic link to config.h
sudo ln -s /System/Library/Frameworks/Ruby.framework/Versions/2.0/Headers/ruby/config.h /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/config.h
matanco
  • 2,096
  • 1
  • 13
  • 20
  • Thanks but after you suggested investigating xCode I discovered another Stackoverflow answer that had the answer in the comments. I've posted my solution. – CaribouCode Oct 13 '15 at 13:47