问题Max Pleaner的建议解决了问题中显示的错误。
gem install bundler
但是它很快遇到了第二个问题:
Gem :: Ext :: BuildError:错误:无法构建gem本机扩展。
当前目录:
/Users/antkong/Documents/Personal/wd/terraforming-assume-role/bin/ruby/2.3.0/gems/json-2.2.0/ext/json/ext/generator
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r
./siteconf20191105-34055-mnnpg3.rb extconf.rb mkmf.rb找不到
红宝石的头文件位于
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
extconf失败,退出代码1
Gem files will remain installed in /Users/antkong/Documents/Personal/wd/terraforming-assume-role/bin/ruby/2.3.0/gems/json-2.2.0
for inspection.
Results logged to
/Users/antkong/Documents/Personal/wd/terraforming-assume-role/bin/ruby/2.3.0/extensions/universal-darwin-18/2.3.0/json-2.2.0/gem_make.out
An error occurred while installing json (2.2.0),and Bundler cannot continue.
Make sure that `gem install json -v '2.2.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
coveralls was resolved to 0.8.21,which depends on
simplecov was resolved to 0.14.1,which depends on
json
遵循此答案中的指示的解决方案:https://stackoverflow.com/a/58084238/58129
我复制以下步骤:
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
shareeditflag
本文链接:https://www.f2er.com/3162514.html