記錄問題
轉(zhuǎn)載自:http://www.reibang.com/p/7ea686bc2a1a西乖,侵權(quán)請聯(lián)系刪除
報錯
最新系統(tǒng)安裝cocoapods報錯
/local/bin cocoapods
Password:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20201123-4548-32dfh3.rb extconf.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
原因是因?yàn)?/h3>
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:找不到這個
檢查一下本地的目錄是
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/rbconfig.rb:
注意
在找ruby-2.6.0的時候,因?yàn)槊總€人的ruby環(huán)境不一樣所以要注意自己的目錄是否是對的上我的是ruby 2.6.3柒昏,所以不建議直接復(fù)制目錄cd進(jìn)去渴频,一步步找自己本地的文件
我的路徑是
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0
解決方案
報錯里提示universal-darwin19 本地的卻是universal-darwin20
所以將20復(fù)制粘貼將universal-darwin20文件改成universal-darwin19
在 ruby-2.3.0 目錄下創(chuàng)建一個 universal-darwin18
在console下:
cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-XXX??
mkdir universal-darwinXX??
cp -r ./universal-darwinXX??/* ./universal-darwinXX??/
??根據(jù)本地的需要去修改
</article>