Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bundle install is not successful cannot install ffi 1.9.9 osx 10.9

Tags:

rubygems

ffi

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.

like image 204
Mohamed Sobhy Avatar asked Jun 28 '15 13:06

Mohamed Sobhy


3 Answers

For me this issue was fixed by running:

bundle update ffi

Looks like the gem authors fixed these install issues in version 1.13.0

like image 182
nates Avatar answered Oct 20 '22 13:10

nates


Thanks God, I was able to solve the problem,,,

Turned out to be that one of the requirements is to have the "Command Line Tools" already installed on the system [using: Mac OSX 10.9] I was counting on that I already have "Xcode" installed, thats why I thought that "Command Line Tools" is bundled and installed with Xcode and it was but I just needed to configure "Xcode" properly....by doing the following:

1.start "Xcode"....

2.Go to "Preferences"

3.Select "Locations" tab

4.Command Line Tools: = select the version of "Xcode" that is already installed on the system. [Drop down menu]

5.Relaunch "Terminal"

6.Clear "Drush" cache

    drush cc drush

7.Run:

    gem install ffi -v '1.9.9'

and it was successful.

    bundle install

success also.

Please note: that I also did reinstall:

RVM:

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

Bundler 1.10.5:

    gem install bundler 

Hope this would help.

like image 34
Mohamed Sobhy Avatar answered Oct 20 '22 12:10

Mohamed Sobhy


A likely culprit would be that Xcode path is wrong. Make sure there is valid Xcode then run this first.

sudo xcode-select --switch /Applications/Xcode.app
like image 5
samwize Avatar answered Oct 20 '22 14:10

samwize