ERROR: Error installing ffi: ERROR: Failed to build gem native extension

gem::ext::builderror: error: failed to build gem native extension.
error: failed to build gem native extension cocoapods
an error occurred while installing ffi 1.9 6 and bundler cannot continue
could not find ffi-1.9 2.5 in any of the sources
configure error in library ruby gems 2.6 0 gems ffi 1.12 2 ext ffi_c libffi x86_64
ruby package manager
an error occurred while installing sassc (2.2 1 and bundler cannot continue)
failed to build gem native extension mac cocoapods

I am getting this error in Mac 64 bit and have xcode inatalled on machine.

Building native extensions.  This could take a while...
ERROR:  Error installing ffi:
    ERROR: Failed to build gem native extension.

/Users/jreddy/.rvm/rubies/ruby-1.8.7-p302/bin/ruby extconf.rb
checking for ffi.h in /usr/local/include... no
checking for rb_thread_blocking_region()... no
checking for ruby_thread_has_gvl_p()... no
checking for ruby_native_thread_p()... no
checking for rb_thread_call_with_gvl()... no
creating extconf.h
creating Makefile

make
sh: make: command not found

I use homebrew, so after I did brew install libffi the gem installed for me. I have Xcode 4.2 tools active (with xcode-select). I did have to close and open a new Terminal window for home-brew's install to be recognised by the gem installation. But I could only get it working with ruby 1.8.7 but not 1.9.3 (using rvm).

Fails to install on OSX 10.14 (Mojave) · Issue #651 · ffi/ffi · GitHub, native extensions. This could take a while ERROR: Error installing ffi: ERROR​: Failed to build gem native extension. current directory:  Hi guys, Travis CLI does not seem to be willing to install on my machine (I'm using this docker image as my container). root@ff8ac5453dbc:~# gem install travis Building native extensions.

This one worked for me: brew link libffi --force

Gem install ffi failed · Issue #613 · ffi/ffi · GitHub, When I install ffi "Installing ffi 1.9.21 with native extensions" I received this errors: Gem::Ext::BuildError: ERROR: Failed to build gem native  Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

Updating the Command Line Tools within XCode and following these steps: https://stackoverflow.com/a/10610951/1691 did it for me

Failed to build gem native extension on macOS High Sierra · Issue , Trying to install jazzy gem which depends on ffi . Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/  $ rvm install ruby-2.2.5 $ rvm use ruby-2.2.5 $ gem install bundler $ bundle install This caused me to hit the famed ffi installation errors, that are reported around the StackOverflow environment:

I am also on OS X Lion. I re-installed XCode and ffi installed successfully using bundle install.

Failed to build gem native extension · Issue #552 · ffi/ffi · GitHub, I am a user of a gem that requires ffi On a fresh Ubuntu install, I apt install ruby and then gem install ffi. I get the following error message:  Installing any gems in ruby will bring ERROR: failed to build gem native extension Hot Network Questions A variation of the law of large numbers for random points in a square

I had this problem on OSX 10.10.15 with ruby-2.0.0-p481 under rvm. All i had to do was

sudo xcodebuild -license

It won't fix all cases but it might fix some

Installing ffi 1.9.21 with native extensions on Ruby 2.4.2, Ubuntu , ERROR: Error installing ffi: ERROR: Failed to build gem native extension. current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c  here is a solution for the windows users, hope it helps!. Using MySQL with Rails 3 on Windows. Install railsinstaller-> www.railsinstaller.org (I installed it to c:\Rails)

An error occurred while installing ffi (1.9.25), and Bundler cannot , An error occurred while installing ffi (1.9.25), and Bundler cannot continue. Hello there, if anyone I tried to run. gem install ffi -v '1.9.25' --source 'https://rubygems.​org/' The notable part is "failed to build native extension". That means its  The above answers did not work for me; my bundler config has disable-shared-gems enabled which causes additional issues. I'm using Yosemite 10.10.1, Rails 3.2.x, and Ruby 1.9.3p550.

Error: Failed to build gem native extension for ffi on Mac OS X, Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /usr/local/lib/ruby/gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c  For Xcode 11 on macOS 10.14, this can happen even after installing Xcode and installing command-line tools and accepting the license with sudo xcode-select --install sudo xcodebuild -license accept The issue is that Xcode 11 ships the macOS 10.15 SDK which includes headers for ruby2.6, but not for macOS 10.14's ruby2.3.

Update Fails on ffi Install in Ruby, gitlab-development-kit directory which resulted in the following errors: Gem::Ext::​BuildError: ERROR: Failed to build gem native extension. Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Comments
  • Re installed xcode tools again! It worked .
  • brew install ruby fixed it for me, whereas brew install libffi did not.
  • I didn't have to follow those extra steps - just updating XCode and running bundle install again did the job. Thanks!
  • this one helped me (other options didn't)
  • macports needs to be installed on the system level for it to work with sudo.