-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fail to Building native extensions. on Mac OSX 10.13.6 #78
Comments
It looks like you don't have the Ruby development headers installed. The easiest way I know to get them on OSX is to install XCode. Relevant links: |
and
solve the issue. |
After your commands, restarting macOS is required for me. |
macos 10.14.6. |
same error |
Same error, (trying to install Jazzy) |
You might need to install the command line tools: https://kevinpotgieter.wordpress.com/2012/12/06/ruby-gem-install-mkmf-rb-cant-find-header-files-for-ruby-problem/ |
Unfortunately I already have them installed, any other ideas? |
This might be specific to MacOS 10.14. Apparently some development files got moved, or stopped getting installed by default, or...something. A couple of people have recommended running some variation of this:
References: |
Yes, I was just about to post. |
Running the .pkg in ~/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg worked for me, so thanks for the tips! Incidentally a colleague of mine didn't have that packages folder on his machine. I'd install the Xcode 11 update from the App Store and he'd deleted and installed from the download from the apple developer site, so there may be a difference for people if they don't use the App Store (maybe you can get the pkg from the apple developer site downloads page?) |
Installing the package fixed that problem for me, but it's not picking up my RVM ruby version when I do bundle install now... even though ruby --version DOES display it. Any ideas? |
The cause 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. You can verify that this is your problem by running
which on macOS 10.14 with Xcode 11 prints the non-existent path
There might still be a macOS 10.14 SDK in
This should now correctly print
Likewise, |
For me (Xcode 11 on Mojave as well),
Reference: https://stackoverflow.com/a/58231417/580850 |
If you are on OSX 10.15+, the headers package is no longer available. I fixed this issue by setting
|
I was trying to install guard today and ran into an issue: mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h I found this post - castwide/vscode-solargraph#78 - which suggested the problem is because my mac is 10.14 I had to run this command which then allowed me to install guard. open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg I wanted to mention this to your team incase you want to include it, though you may not feel it is relevant to Ada students! David
Thanks! I'm on 10.14.4 and this was still necessary. |
Thank you sir! |
Only this solve my issue! Salute Sir! |
Nothing worked for me on 10.15.7. |
None of the above worked on
|
Ruby on MacOS is frequently problematic, especially if you're using whatever janky version of Ruby ships with the OS, which often does not include the stuff you need to natively compile depenencies like Nokogiri. The problems are not limited to Solargraph. One common solution is to use rbenv, which Solargraph makes an effort to support. |
Building native extensions. This could take a while...
ERROR: Error installing solargraph:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180912-38268-nmeu8e.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/eventmachine-1.2.7 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/eventmachine-1.2.7/gem_make.out
The text was updated successfully, but these errors were encountered: