捆绑安装不成功无法安装 ffi 1.9.9 osx 10.9

bundle install is not successful cannot install ffi 1.9.9 osx 10.9

bundle install  
Fetching gem metadata from https://rubygems.org/...........  
Fetching gem metadata from https://rubygems.org/..  
Resolving dependencies...  
Enter your password to install the bundled RubyGems to your system:   
Using addressable (2.3.8)   
Using sass (3.4.15)   
Using sassy-maps (0.4.0)   
Using breakpoint (2.5.0)   
Using chunky_png (1.3.4)   
Using coderay (1.1.0)   
Using multi_json (1.11.1)   
Using compass-core (1.0.3)   
Using compass-import-once (1.0.5)   
Using rb-fsevent (0.9.5)   
Installing ffi (1.9.9)   
Gem::Installer::ExtensionBuildError: 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

Gem files will remain installed in /Users/Moe/.bundler/tmp/8353/gems/ffi-1.9.9 for inspection.
Results logged to /Users/Moe/.bundler/tmp/8353/gems/ffi-1.9.9/ext/ffi_c/gem_make.out

An error occurred while installing ffi (1.9.9), and Bundler cannot continue. Make sure that gem install ffi -v '1.9.9' succeeds before bundling.

感谢大神,问题终于解决了,

结果是要求之一是系统上已经安装了 "Command Line Tools" [using: Mac OSX 10.9] 我指望我已经安装了 "Xcode",这就是为什么我认为 "Command Line Tools" 是与 Xcode 捆绑并安装的,但我只需要正确配置 "Xcode" ....通过执行以下操作:

1.start "Xcode".....

2.Go 到 "Preferences"

3.Select "Locations" 选项卡

4.Command Line Tools:= select 系统上已安装的 "Xcode" 版本。 [下拉菜单]

5.Relaunch "Terminal"

6.Clear"Drush"缓存

    drush cc drush

7.Run:

    gem install ffi -v '1.9.9'

成功了。

    bundle install

成功也。

请注意:我也重新安装了:

RVM:

    \curl -sSL https://get.rvm.io | bash -s stable

捆绑器 1.10.5:

    gem install bundler 

希望这会有所帮助。

这条指令帮助了我

$ cd /usr/local/lib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib

来源:https://gist.github.com/Dreyer/0a0976f5606c0c963ab9a622f03ee26d

一个可能的罪魁祸首是 Xcode 路径错误。确保有有效的 Xcode 然后 运行 这首先。

sudo xcode-select --switch /Applications/Xcode.app

我在 Ubuntu 20.04.2 LTS

上遇到了类似的问题

已被运行解决

sudo apt install libffi-dev
gem inst ffi

https://github.com/ffi/ffi/issues/608#issuecomment-363698071

对我来说,这个问题已由 运行 解决:

bundle update ffi

看起来 gem 作者在 version 1.13.0

中修复了这些安装问题