微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

CooaPods的终端安装

如何解决CooaPods的终端安装

这是我的终端导出:

这里是 pod init:

Masons-iMac:GoodDays nacly$ ls
GoodDays        GoodDaysTests
GoodDays.xcodeproj  GoodDaysUITests

Masons-iMac:GoodDays nacly$ pod init
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory

这里是 cocoapods 的安装:

Masons-iMac:GoodDays nacly$ sudo gem install cocoapods
Password:
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.14.2/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 ./siteconf20210114-6600-1nfobc.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment,ruby-dev or ruby-devel for example.

extconf Failed,exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.14.2/gem_make.out

最后一点。我尝试更新 RubyGems:

Masons-iMac:GoodDays nacly$ gem update --system
Updating rubygems-update
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

我也试过这个:

Masons-iMac:GoodDays nacly$ sudo gem install cocoapods -n/usr/local/bin
Successfully installed nanaimo-0.3.0
Successfully installed colored2-3.1.2
Successfully installed claide-1.0.3
Successfully installed atomos-0.1.3
Successfully installed xcodeproj-1.19.0
Successfully installed ruby-macho-1.4.0
Successfully installed molinillo-0.6.6
Successfully installed gh_inspector-1.1.3
Successfully installed fourflusher-2.3.1
Successfully installed escape-0.0.4
Successfully installed cocoapods-try-1.2.0
Successfully installed netrc-0.11.0
Successfully installed cocoapods-trunk-1.5.0
Successfully installed cocoapods-search-1.0.0
Successfully installed cocoapods-plugins-1.0.0
Successfully installed cocoapods-downloader-1.4.0
Successfully installed cocoapods-deintegrate-1.0.4
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.14.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20210114-6782-1lu9tjk.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment,exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.14.2/gem_make.out
Masons-iMac:GoodDays nacly$ ls
GoodDays        GoodDaysTests
GoodDays.xcodeproj  GoodDaysUITests
Masons-iMac:GoodDays nacly$ pod init
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。