My Mac auto-upgraded Xcode to version 11 today and ever since then I'm unable to run docker sync. Whenever I do I get the following error:
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
docker-machine+vbox (I think?)
default
version: "2"
syncs:
#IMPORTANT: ensure this name is unique and does not match your other application container name
partnerbase-api: #tip: add -sync and you keep consistent names as a convention
src: './'
notify_terminal: true
sync_userid: ${UID}
sync_excludes: ['.git', 'local-m2']
watch_args: '-v' # make watching verbose
monit_enable: true
monit_interval: 5
monit_high_cpu_cycles: 2
OSX Mojave
Please use Google once before opening an issue :)
Here is what I have tried so far:
sudo xcode-select --install and then sudo xcodebuild -license to make sure I have the latest Xcode Command Line Tools installed and have agreed to Apple's license. That didn't work.
Then I opened up Xcode and looked at the Preferences to make sure the locations of Command Line Tools is correct. It is.
Then I did this:
rbenv install 2.6.4
rbenv global 2.6.4
eval "$(rbenv init -)"
Once with that version (2.6.4) and then again with version 2.3.0. I don't have much experience with Ruby so that was a stab in the dark for me. Either way, it didn't work.
Then I tried rebooting because, why not? That didn't work.
I did use Google once. I've used it multiple times. I'm still using it, in fact. In doing so I've found others that also have this problem. Some of the things that were suggested seemed to work for some of those people but not everyone including myself which is why I submitted this issue. I'm assuming that if I'm having this problem then others are as well and there will be more to come considering Apple just dropped Xcode 11 yesterday and more and more people are going to be getting automatically upgraded like I was.
I recognize that this does appear to be a Ruby problem more so than docker-sync but it's affecting docker-sync for me and others. If you don't want to deal with it, then its your prerogative to close this issue and be done with it, but you'd be doing the community a service if you could at least help us troubleshoot this issue.
@DarrellBrogdon fair enough sorry, usually i would have expected sudo xcode-select --install to fix it, since you are missing the headers. Be sure you did that right.
Anything else, are you using homebrew and if now, why not? If you play with your Mac system ruby, you get in trouble regulary. Assuming you are using brew ruby, uninstall that ruby if you yet did not do so, then install it again and install docker-sync
Yes several user have several solutions and the only reaons for that is "tampering with system ruby or not" some run docker-sync with sudo and all kind of quirks - i suggest not doing either of those things.
Install homebrew, install ruby there, if you like and do ruby dev, install rvm and then ruby ( what suits you better ) and then use docker-sync.
OSX ruby is not ment to be used by a user-space user - whyever.
Let me know if that helps
I am using Homebrew, yes. I've never done anything with the Mac system Ruby. The only Ruby-related Homebrew I have installed is ruby-build, though I'm unsure where that came from since I don't recall ever installing it myself. Could that be the problem? I have done a brew update && brew upgrade but it didn't fix this particular problem.
I've never run docker-sync as root. I make it a policy to try to not to do anything with sudo on my Mac unless I have to.
So Are you saying I _should_ install ruby with Homebrew? If so, I see support for 2.6, 2.5, 2.4, and 2.0. Which one should I install?
Same over here. Upgrade to Xcode 11 breaks my docker-sync installation
For me too. After Xcode update , docker-sync don't works
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
A work-around is to install rvm:
\curl -sSL https://get.rvm.io | bash
rvm install "ruby-2.3.8"
rvm use 2.3
gem install docker-sync
A work-around is to install rvm:
\curl -sSL https://get.rvm.io | bash rvm install "ruby-2.3.8" rvm use 2.3 gem install docker-sync
Thank you! This is the only thing that worked for me :)
Well you are all still using sytem ruby if you can fix it by installing RVM.
You should either use RVM, which i would not recommend if you do not need the flexibility of choosing / having several ruby versions ( you are basically a multi project ruby developer ).
When not that, rather pick a stable ruby from brew like 2.4 and go for it, maybe 2.5 (if compatible, there have been some braking changes).
And if picking RVM, you should use brew to install it, or you create a system of junk over time ( and a non reproduceable setup ).
But that is just IMHO - whatever works for you guys
This will help:
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
This will help:
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
That's effectively downgrading the command line tools. Every Xcode upgrade will break it again
Hi - I am running into this issue as well.
I happen to have Ruby installed both through Homebrew as well as separately (I assume it was downloaded separately by some other application I installed which uses it).
Can someone explain to me what is the connection to Ruby and why the version of Ruby matters?
Also if I have two installations of ruby:
/usr/bin/ruby
/usr/local/Cellar/ruby
Which one will Docker-Sync try to use?
FYI for everyone on Mac 10.14+ the below works perfectly to address this issue:
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
sudo xcodebuild -license accept
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Guys please understand, docker-sync is no "ruby schooling" or "how OSX deals with ruby" or how "homebrew works with ruby".
I understand, that docker-sync's dependency on ruby is a burden and at some point involves this kind of topics - but on this level, docker-sync points at developers. That said, i understand that it is the responsibility of each develop to deal with the devop topic on how to run ruby on OSX and what is required to do so.
This issue queue is also not able to provide you find the additional informations on how ruby evaluates PATH and how it deals with multi-version installation, now how to deal with PATH in general and how scoping works - this is all out of scope. Those are alltogether normal OSX/Linux topics and have nothing to do with docker-sync at all.
Installing, maintaining and fixing ruby, before or after or during a OSX migration, cannot be really disucssed in docker-sync's issues.
You find all those topics on the web / homebrew issues / OSX related issues since they have absolutely nothing to do with docker-sync.
Docker-sync is a ruby gem and it runs as a normal ruby gem - no strings attached.
Thanks for your understanding!
Below worked for me
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
sudo xcodebuild -license accept
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Most helpful comment
A work-around is to install rvm: