I updated XCode on my Mac and since then when starting Docker using docker-sync-stack start
I get this error message:
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
I tried installing ruby with this: brew install rbenv ruby-build
but this does not change anything.
Does anybody know how I can fix it?
Thanks!
If you want to get a deeper insight into the issue:
https://silvae86.github.io/sysadmin/mac/osx/mojave/beta/libxml2/2018/07/05/fixing-missing-headers-for-homebrew-in-mac-osx-mojave/
As of Xcode 11, it seems like the ruby development headers are no longer included, so you will need to manually install them outside of Xcode Command Line Tools.
E.g. for me using rbenv i did
Then ran bundle install and everything worked as expected.
When upgrading XCode you need to install the Command-Line Tools and additionally accept the terms and conditions:
Then:
None of the other solutions worked for me, here's what I ran to resolve the issue on Mac OS 10.14.x:
As @bdorfman said in his comment, the Ruby headers are no longer included as of Xcode 11 build but they seem to try to make a new build for this as soon as possible (?): https://discuss.circleci.com/t/xcode-11-gm-seed-2-released/32505/12.
What worked for me was to use
rbenv
like @bdorfman said:But with the extra step of adding
docker-sync
to your new ruby version. Since after you change the ruby version (for example)And then running gem list:
(does not contains docker-sync)
If you run the gem install for docker-sync you will use the docker-sync for your rbenv managed ruby.
$ gem install docker-sync
For Xcode 11 I fixed this by also installing of
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
package.