简体   繁体   English

第一次安装Cocoapods出现问题

[英]Trouble installing Cocoapods for first time

I am trying to install cocoapods using:我正在尝试使用以下方法安装 cocoapods:

sudo install cocoapods

this is what i am receiving back这就是我收到的回复

usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...

This is my second attempt to install cocoapods.这是我第二次尝试安装 cocoapods。 The first attempt to install failed and said I may need to install ruby-dev?第一次尝试安装失败,说我可能需要安装ruby-dev? I tried to install that then started receiving the above message.我尝试安装它,然后开始收到上述消息。

The right command for installing Cocoapods is:安装Cocoapods的正确命令是:

sudo gem install cocoapods

As shown on their Getting Started page.如他们的入门页面所示。

Thank you: After using "gem" I ran into the following issue:谢谢:使用“gem”后,我遇到了以下问题:

    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.12.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 ./siteconf20200415-22388-129pjat.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

I discovered that I needed to install some additional items from xcode using:我发现我需要使用 xcode 安装一些额外的项目:

xcode-select --install

After about 20 minutes of installing and rebooting the computer i was then able to use:安装并重新启动计算机大约 20 分钟后,我就可以使用:

sudo gem install cocoapods

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM