Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on macOS Mojave while installing #15

Open
telmen opened this issue Mar 5, 2019 · 5 comments
Open

Error on macOS Mojave while installing #15

telmen opened this issue Mar 5, 2019 · 5 comments

Comments

@telmen
Copy link

telmen commented Mar 5, 2019

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

current directory: /usr/local/lib/ruby/gems/2.6.0/gems/unf_ext-0.0.7.5/ext/unf_ext

/usr/local/opt/ruby/bin/ruby -I /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0 -r ./siteconf20190305-71068-fwf5h8.rb extconf.rb
checking for -lstdc++... *** 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
--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=/usr/local/Cellar/ruby/2.6.0/bin/$(RUBY_BASE_NAME)
--with-static-libstdc++
--without-static-libstdc++
--with-stdc++lib
--without-stdc++lib
/usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:467:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:552:in try_link0'
from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:570:in try_link' from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:789:in try_func'
from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:1016:in block in have_library' from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:959:in block in checking_for'
from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:361:in block (2 levels) in postpone' from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:331:in open'
from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:361:in block in postpone' from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:331:in open'
from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:357:in postpone' from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:958:in checking_for'
from /usr/local/Cellar/ruby/2.6.0/lib/ruby/2.6.0/mkmf.rb:1011:in have_library' from extconf.rb:6:in

'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/usr/local/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-18/2.6.0/unf_ext-0.0.7.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/2.6.0/gems/unf_ext-0.0.7.5 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-18/2.6.0/unf_ext-0.0.7.5/gem_make.out

@Xgamefactory
Copy link

same here

@zntfdr
Copy link

zntfdr commented Oct 22, 2019

I had the same issue.

What did the trick for me was following this Stack Overflow answer that I quote here:

For macOS 10.14 Mojave, make sure you have already installed command line tools via xcode-select --install and the run the following command to install std headers.

sudo open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Now try your command again.

Then I had other issues with Ruby but that's for another day 😆

@Krishna
Copy link

Krishna commented May 1, 2020

I was running into a problem installing a gem dependency of fastlane on macOS 10.15.3 (Catalina), and google led me to this issue.

@zntfdr solution doesn't work on Catalina.

After a bit of googling I found this, which worked to fix my problem:

$ export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
$ gem install unf_ext -v '0.0.7.5'

I think this may also be relevant to this issue?

Hope this helps.

@vaibhavhrt
Copy link

macOS Big Sur

Version 11.2.1

Delete & reinstall Xcode command line developer tools

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

@leafOfTree
Copy link

macOS Big Sur

Version 11.2.1

Delete & reinstall Xcode command line developer tools

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

Great tip, which also works for version 12.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@Krishna @zntfdr @telmen @leafOfTree @Xgamefactory @vaibhavhrt and others