Docker for Mac - mkmf.rb cannot find header files for ruby

I updated Xcode on my Mac and since then, when starting Docker with, docker-sync-stack startI 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-buildbut that doesn’t change anything.

Does anyone know how I can fix this?

Thank!

+26
source share
9 answers

When upgrading Xcode, you need to install the command line tools and additionally accept the conditions:

sudo xcode-select --install

Then:

sudo xcodebuild -license
+34
source

None of the other solutions helped me, here is what I used to solve the problem on Mac OS 10.14.x:

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
+31
source

Xcode 11 , /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg.

+13

Xcode 11, , ruby , Xcode.

. rbenv

rbenv install 2.6.4
rbenv global 2.6.4
eval "$(rbenv init -)"

, .

+10

fastlane. tadman , Xcode 10.2.1 ( ). XCode, Preferences, Locations . .

+7

@bdorfman , Ruby Xcode 11, , , (?): https://discuss.circleci.com/t/xcode-11-gm-seed-2-released/32505/12.

rbenv, @bdorfman:

rbenv install 2.6.4
rbenv global 2.6.4
eval "$(rbenv init -)"

docker-sync ruby. ruby ()

$ ruby -v
ruby 2.6.4p104 (2019-08-28 revision 67798) [x86_64-darwin18]

:

$ gem list
bigdecimal (default: 1.4.1)
bundler (default: 1.17.2)
cmath (default: 1.0.0)
csv (default: 3.0.9)
date (default: 2.0.0)
dbm (default: 1.0.0)
did_you_mean (1.3.0)
e2mmap (default: 0.1.0)
etc (default: 1.0.1)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.1.0)
forwardable (default: 1.2.0)
io-console (default: 0.4.7)
ipaddr (default: 1.2.2)
irb (default: 1.0.0)
json (default: 2.1.0)
logger (default: 1.3.0)
matrix (default: 0.1.0)
minitest (5.11.3)
mutex_m (default: 0.1.0)
net-telnet (0.2.0)
openssl (default: 2.1.2)
ostruct (default: 0.1.0)
power_assert (1.1.3)
prime (default: 0.1.0)
psych (default: 3.1.0)
rake (12.3.2)
rdoc (default: 6.1.2)
rexml (default: 3.1.9)
rss (default: 0.2.7)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
shell (default: 0.7)
stringio (default: 0.0.2)
strscan (default: 1.0.0)
sync (default: 0.5.0)
test-unit (3.2.9)
thwait (default: 0.1.0)
tracer (default: 0.1.0)
webrick (default: 1.4.2)
xmlrpc (0.3.0)
zlib (default: 1.0.0)

( )

gem docker-sync, docker-sync rbenv.

$ gem install docker-sync

+6

:

OSX Mojave :

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

.

+6

XCode 11 MacOS 10.14 XCode,

xcode-select --install
xcodebuild -license accept

, Xcode macOS 10.15 SDK, ruby2.6, macOS 10.14 ruby2.3. , ,

ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'

macOS 10.14 Xcode 11

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0

/Library/Developer/CommandLineTools/SDKs macOS 10.14 SDK. , , . , SDKROOT, ruby2.3:

SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/
export SDKROOT
ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'

/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk//System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0

, gem install , SDKROOT.

+2

:

Mac OS X 10.14 stopped putting inclusion libraries in their usual location, / usr / include, saving them only inside the Xcode directory.

To confirm that this is a problem, simply run ls /usr/include. If the result is empty, this is really a problem.

Apple supplies the "obsolete installer" so you can install the Headers in the "old place." To solve the problem, just run this:

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

https://silvae86.imtqy.com/sysadmin/mac/osx/mojave/beta/libxml2/2018/07/05/fixing-missing-headers-for-homebrew-in-mac-osx-mojave/

0
source

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


All Articles