Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
failed to build gem native extension. xcode
Fetching nio4r 2.5.4
Installing nio4r 2.5.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/nio4r-2.5.4/ext/nio4r
/Users/ianvaughan/.asdf/installs/ruby/2.7.1/bin/ruby -I /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0 -r ./siteconf20200918-40223-cj3k1e.rb extconf.rb
checking for unistd.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/ianvaughan/.asdf/installs/ruby/2.7.1/bin/$(RUBY_BASE_NAME)
--with-unistd-dir
--without-unistd-dir
--with-unistd-include
--without-unistd-include=${unistd-dir}/include
--with-unistd-lib
--without-unistd-lib=${unistd-dir}/lib
/Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:471:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:613:in `try_cpp'
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:1124:in `block in have_header'
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:971:in `block in checking_for'
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:331:in `open'
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:361:in `block in postpone'
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:331:in `open'
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:357:in `postpone'
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:970:in `checking_for'
from /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/mkmf.rb:1123:in `have_header'
from extconf.rb:15:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/nio4r-2.5.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/nio4r-2.5.4 for inspection.
Results logged to /Users/ianvaughan/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/nio4r-2.5.4/gem_make.out
An error occurred while installing nio4r (2.5.4), and Bundler cannot continue.
Make sure that `gem install nio4r -v '2.5.4' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
active_storage_validations was resolved to 0.9.0, which depends on
rails was resolved to 6.0.3.1, which depends on
actioncable was resolved to 6.0.3.1, which depends on
nio4r
> sudo xcodebuild -license
Password:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
> xcode-select --print-path
/Library/Developer/CommandLineTools
> which gcc
/usr/bin/gcc
> which gcc-4.2
gcc-4.2 not found
> sudo llvm-gcc
Password:
xcrun: error: active developer path ("/Library/Developer/CommandLineTools") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
> gcc
xcrun: error: active developer path ("/Library/Developer/CommandLineTools") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
> sudo xcode-select --switch path/to/Xcode.app
xcode-select: error: invalid developer directory 'path/to/Xcode.app'
https://github.com/CocoaPods/CocoaPods/issues/1727
https://developer.apple.com/download/more/?name=for%20Xcode%20-
https://github.com/CocoaPods/CocoaPods/issues/1727
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment