Gem :: Ext :: BuildError: ERROR: Failed to create custom gem extension - nio4r

I am trying to install all the gems in my gemfile and its dependencies, so I just ran the Bundler (installing packages or packages). This failed when installing nio4r 1.1.1 with its own extensions, the following is a list of gem_make.out.

/opscode/chef/embedded/bin/ruby.exe -r ./siteconf20150924-7480-ocwr34.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 = / opscode / chef / embedded / bin / ruby
/opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb-00-0034:in `try_do ': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb[65:in `try_cpp '
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:1038:in `block in have_header '
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:889:in `block in checking_for '
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rbhaps40:in `block (2 levels) in postpone '
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rbhaps10:in `open '
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rbhaps40:in `block in postpone '
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rbhaps10:in `open '
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rbhaps36:in `postpone '
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:888:in `checking_for '
    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:1037:in `have_header '
    from extconf.rb: 3: in ``

extconf failed, exit code 1

I see the bunch checking unistd.h and failing at that point. I made sure this header is available in PATH and also installed ruby ​​devkit for my version. Execution gem install nio4ralso gives the same error.

+4
source share
1 answer

try xcode-select --installfirst. This may be a problem with the xcode build system

0
source

Source: https://habr.com/ru/post/1608813/


All Articles