在OSX El Capitan上安装cf-uaac时出错

时间:2016-01-14 09:40:06

标签: ruby macos cloudfoundry cloudfoundry-uaa pivotal-cloud-foundry

尝试在OS X El Capitan上安装cf-uaac gem。

$ gem install cf-uaac

结果:

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

2 个答案:

答案 0 :(得分:1)

经过一番研究后,看来El Capitan已经做了一些与Ruby有关的变化。针对修复的一些建议集中在重新启动并对系统进行一些危险的更改。

以下是我如何使用它。

已安装rbenv

brew install rbenv ruby-build

将rbenv添加到.bash_profile

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

来源~/.bash_profile

source ~/.bash_profile

使用rbenv安装Ruby

rbenv install 2.2.3

全局设置此版本

rbenv global 2.2.3

检查您的Ruby版本

ruby -v

安装cf-uaac

gem install cf-uaac

任何有更好解决方案的人都请告诉我。

答案 1 :(得分:0)

安装Xcode后,此问题已解决。

以下是安装xcode的命令:

$ xcode-select --install

$ gem install cf-uaac

参考 enter image description here