ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

记录cocoapods 的一次报错

2022-06-09 15:31:32  阅读:187  来源: 互联网

标签:Ruby 记录 cocoapods Library 报错 install ruby 2.6


使用pod init 出现bad interpreter: No such file or directory

 

导致这个问题出现的原因,升级了macOS系统造成的cocoapods不能正常使用

So,就跟着更新一遍就好了,然而...

 

 

$ sudo gem update --system

$ sudo gem install cocoapods -n/usr/local/bin

 

当执行 $ sudo gem install cocoapods -n/usr/local/bin, 报错了

 

 

You might have to install separate package for the ruby development environm

具体更多的输出信息:

/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 ./siteconf20200430-75028-3e0jka.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.12.2 for inspection.

Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/gem_make.out

 

 

好,这时从网上看到的解决方法

输入 xcode-select --install 

 

然而,提示 “不能安装该软件因为当前无法从软件更新服务器获得

 

解决办法: 

1)升级xcode到最新版本,然后执行xcode-select –install 

2)或者去developer apple网站上手工下载对应版本的 Command Line Tools

 

好,以为这样可以了,执行pod init 

 

报错:

 

Traceback (most recent call last):

5: from /usr/local/bin/pod:23:in `<main>'

4: from /usr/local/bin/pod:23:in `load'

3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'

2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:49:in `run'

1: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:130:in `verify_minimum_git_version!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:118:in `git_version': Failed to extract git version from `git --version` ("xcrun: error: active developer path (\"/Applications/Xcode11.1.app/Contents/Developer\") does not exist\nUse `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.\nSee `man xcode-select` for more details.\n") (RuntimeError)

 

 

此时执行 sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

完成,究其原因,因为此Xcode是通过developer 下载,原来的又是拖动删除,导致路径错误。

 

标签:Ruby,记录,cocoapods,Library,报错,install,ruby,2.6
来源: https://www.cnblogs.com/LiuZX90/p/16359464.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有