gem install 问题 (not found ruby/config.h 和You don‘t have write permissions into the /usr/bin/directo)

not found ruby/config.h 和You don't have write permissions into the /usr/bin/directory

macOS Catalina 15.6 + ruby 2.6.3p62 (2019-04-16 revision 67580)

现在运行成功了,log找不到了。

大概是在运行sudo gem install xxx的时候

第一个问题报的是 什么extension问题,然后打开指定路径的log (mkmf.log)

会发现里面有句话,大致就是说 哪一个文件里的ruby.h 调用哪个文件夹下的ruby/config.h

好像是这个文件夹(/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby )

跟同事对比了一下,发现我这个目录下面是darwin20,但是同样的ruby版本,同事的是darwin19

然后copy了过来

gem install 问题 (not found ruby/config.h 和You don‘t have write permissions into the /usr/bin/directo)_第1张图片

(这个参考的是: https://blog.csdn.net/weixin_43974890/article/details/103289838)

第二个问题是权限问题,即便是sudo gem也会报You don't have write permissions into the /usr/bin/directory

sudo gem install xxx -n /usr/local/bin就oK了

(这个参考的是:https://stackoverflow.com/questions/2893889/how-do-i-fix-the-you-dont-have-write-permissions-into-the-usr-bin-directory)

你可能感兴趣的:(OC)