1

Trying to install the cf-uaac gem on OS X El Capitan.

$ gem install cf-uaac

Result:

Fetching: cf-uaa-lib-3.2.5.gem (100%)
Successfully installed cf-uaa-lib-3.2.5
Fetching: highline-1.6.21.gem (100%)
Successfully installed highline-1.6.21
ERROR: Error installing cf-uaac:
       ERROR: Failed to build gem native extension.
     /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

mkmf.rb can’t find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/eventmachine-1.0.3 for inspection.

Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/eventmachine-1.0.3/gem_make.out
code
  • 4,073
  • 3
  • 27
  • 47

2 Answers2

2

After a little research it appears El Capitan has made several changes related to Ruby. Some suggestions for a fix centered around rebooting and making some dangerous changes to the system.

Below is how I got it to work.

Installed rbenv

brew install rbenv ruby-build

Add rbenv to the .bash_profile

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile

Source the ~/.bash_profile

source ~/.bash_profile

Install Ruby with rbenv

rbenv install 2.2.3

Set this version globally

rbenv global 2.2.3

Check your Ruby version

ruby -v

Install cf-uaac

gem install cf-uaac

Anyone with a better solution please let me know.

code
  • 4,073
  • 3
  • 27
  • 47
  • Might be hard to debug because you can't easily go back to your old setup. But was `gem install eventmachine -v 1.0.3` failing? – Amit Kumar Gupta Jan 15 '16 at 04:09
  • I did not try that. I think the issue is El Capitan and the way they changed how Ruby works. I did try some random gems Rails etc... All Failed. – code Jan 15 '16 at 16:50
0

This issue was resolved for me after I installed Xcode.

Following is the command to install xcode:

$ xcode-select --install

$ gem install cf-uaac

Reference Installing Rails on Mavericks

Community
  • 1
  • 1
Jenson
  • 635
  • 2
  • 11
  • 20