• Mac安装CocoaPods


    安装HomeBrew

    1. 安装
    % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    • 1

    安装失败

    % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    
    curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 75010 ms: Couldn't connect to server
    dev@htimacdeiMac ~ % 
    
    • 1
    • 2
    • 3
    • 4
    • 5

    用浏览器访问地址https://raw.githubusercontent.com/Homebrew/install/HEAD/install.shinstall.sh文件下载到本地
    添加权限后执行。

    % chmod 777 install.sh 
    % ./install.sh 
    ==> Checking for `sudo` access (which may request your password)...
    Password:
    ==> This script will install:
    /usr/local/bin/brew
    /usr/local/share/doc/homebrew
    /usr/local/share/man/man1/brew.1
    /usr/local/share/zsh/site-functions/_brew
    /usr/local/etc/bash_completion.d/brew
    /usr/local/Homebrew
    
    Press RETURN/ENTER to continue or any other key to abort:
    ==> /usr/bin/sudo /usr/sbin/chown -R dev:admin /usr/local/Homebrew
    ==> Downloading and installing Homebrew...
    HEAD is now at e137891de49 Merge pull request #16221 from Homebrew/dependabot/github_actions/actions/github-script-7
    fatal: read error: Connection reset by peer
    Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
    Installing from the API is now the default behaviour!
    You can save space and time by running:
      brew untap homebrew/core
    Failed during: /usr/local/bin/brew update --force --quiet
    dev@htimacdeiMac ~ % ./install.sh
    ==> Checking for `sudo` access (which may request your password)...
    Password:
    ==> This script will install:
    /usr/local/bin/brew
    /usr/local/share/doc/homebrew
    /usr/local/share/man/man1/brew.1
    /usr/local/share/zsh/site-functions/_brew
    /usr/local/etc/bash_completion.d/brew
    /usr/local/Homebrew
    
    Press RETURN/ENTER to continue or any other key to abort:
    ==> /usr/bin/sudo /usr/sbin/chown -R dev:admin /usr/local/Homebrew
    ==> Downloading and installing Homebrew...
    HEAD is now at e137891de49 Merge pull request #16221 from Homebrew/dependabot/github_actions/actions/github-script-7
    Installing from the API is now the default behaviour!
    You can save space and time by running:
      brew untap homebrew/core
    ==> Installation successful!
    
    ==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
    Read the analytics documentation (and how to opt-out) here:
      https://docs.brew.sh/Analytics
    No analytics data has been sent yet (nor will any be during this install run).
    
    ==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
      https://github.com/Homebrew/brew#donations
    
    ==> Next steps:
    - Run these two commands in your terminal to add Homebrew to your PATH:
        (echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/dev/.zprofile
        eval "$(/usr/local/bin/brew shellenv)"
    - Run brew help to get started
    - Further documentation:
        https://docs.brew.sh
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    1. 查看版本号
    % brew -v
    Homebrew 4.1.20
    Homebrew/homebrew-core (git revision 87fbe9d16d8; last commit 2023-11-16)
    
    • 1
    • 2
    • 3

    安装Ruby

    1. 查看ruby的可安装版本
    % rvm list known
    # MRI Rubies
    [ruby-]1.8.6[-p420]
    [ruby-]1.8.7[-head] # security released on head
    [ruby-]1.9.1[-p431]
    [ruby-]1.9.2[-p330]
    [ruby-]1.9.3[-p551]
    [ruby-]2.0.0[-p648]
    [ruby-]2.1[.10]
    [ruby-]2.2[.10]
    [ruby-]2.3[.8]
    [ruby-]2.4[.10]
    [ruby-]2.5[.8]
    [ruby-]2.6[.6]
    [ruby-]2.7[.2]
    [ruby-]3[.0.0]
    ruby-head
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    1. 安装最新版ruby
    % rvm install 3.0.0
    Searching for binary rubies, this might take some time.
    No binary rubies available for: osx/12.7/x86_64/ruby-3.0.0.
    Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
    Checking requirements for osx.
    Installing requirements for osx.
    Updating system - please wait
    Installing required packages: autoconf, automake, libtool, pkg-config, coreutils, libyaml, libksba, readline, zlib, openssl@1.1 - please wait
    Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
    Requirements installation successful.
    Installing Ruby from source to: /Users/dev/.rvm/rubies/ruby-3.0.0, this may take a while depending on your cpu(s)...
    ruby-3.0.0 - #downloading ruby-3.0.0, this may take a while depending on your connection...
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 18.6M  100 18.6M    0     0  1928k      0  0:00:09  0:00:09 --:--:-- 2174k
    ruby-3.0.0 - #extracting ruby-3.0.0 to /Users/dev/.rvm/src/ruby-3.0.0 - please wait
    ruby-3.0.0 - #configuring - please wait
    ruby-3.0.0 - #post-configuration - please wait
    ruby-3.0.0 - #compiling - please wait
    ruby-3.0.0 - #installing - please wait
    ruby-3.0.0 - #making binaries executable - please wait
    Installed rubygems 3.2.3 is newer than 3.0.9 provided with installed ruby, skipping installation, use --force to force installation.
    ruby-3.0.0 - #gemset created /Users/dev/.rvm/gems/ruby-3.0.0@global
    ruby-3.0.0 - #importing gemset /Users/dev/.rvm/gemsets/global.gems - please wait
    ruby-3.0.0 - #generating global wrappers - please wait
    ruby-3.0.0 - #gemset created /Users/dev/.rvm/gems/ruby-3.0.0
    ruby-3.0.0 - #importing gemsetfile /Users/dev/.rvm/gemsets/default.gems evaluated to empty gem list
    ruby-3.0.0 - #generating default wrappers - please wait
    ruby-3.0.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
    Install of ruby-3.0.0 - #complete 
    Ruby was built without documentation, to build it run: rvm docs generate-ri
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    1. 查询镜像源
    % gem source -l
    
    • 1
    1. 替换国内镜像源
    % gem sources --remove https://rubygems.org/
    % gem sources --add https://gems.ruby-china.com/
    % gem source -l
    *** CURRENT SOURCES ***
    
    https://gems.ruby-china.com
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    安装CocoaPods

    1. 安装
    % sudo gem install -n /usr/local/bin cocoapods
    Password:
    Fetching colored2-3.1.2.gem
    Fetching ruby-macho-2.5.1.gem
    Fetching nanaimo-0.3.0.gem
    Fetching claide-1.1.0.gem
    Fetching CFPropertyList-3.0.6.gem
    Fetching atomos-0.1.3.gem
    Fetching xcodeproj-1.23.0.gem
    Fetching nap-1.1.0.gem
    Fetching molinillo-0.8.0.gem
    Fetching gh_inspector-1.1.3.gem
    Fetching fourflusher-2.3.1.gem
    Fetching escape-0.0.4.gem
    Fetching cocoapods-try-1.2.0.gem
    Fetching netrc-0.11.0.gem
    Fetching cocoapods-trunk-1.6.0.gem
    Fetching cocoapods-search-1.0.1.gem
    Fetching cocoapods-plugins-1.0.0.gem
    Fetching cocoapods-downloader-2.0.gem
    Fetching cocoapods-deintegrate-1.0.5.gem
    Fetching ffi-1.16.3.gem
    Fetching ethon-0.16.0.gem
    Fetching typhoeus-1.4.0.gem
    Fetching public_suffix-4.0.7.gem
    Fetching fuzzy_match-2.0.4.gem
    Fetching concurrent-ruby-1.2.2.gem
    Fetching httpclient-2.8.3.gem
    Fetching algoliasearch-1.27.5.gem
    Fetching addressable-2.8.5.gem
    Fetching tzinfo-2.0.6.gem
    Fetching i18n-1.14.1.gem
    Fetching activesupport-7.1.2.gem
    Fetching cocoapods-core-1.14.2.gem
    Fetching cocoapods-1.14.2.gem
    Fetching connection_pool-2.4.1.gem
    Successfully installed nanaimo-0.3.0
    Successfully installed colored2-3.1.2
    Successfully installed claide-1.1.0
    Successfully installed CFPropertyList-3.0.6
    Successfully installed atomos-0.1.3
    Successfully installed xcodeproj-1.23.0
    Successfully installed ruby-macho-2.5.1
    Successfully installed nap-1.1.0
    Successfully installed molinillo-0.8.0
    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.6.0
    Successfully installed cocoapods-search-1.0.1
    Successfully installed cocoapods-plugins-1.0.0
    Successfully installed cocoapods-downloader-2.0
    Successfully installed cocoapods-deintegrate-1.0.5
    Building native extensions. This could take a while...
    Successfully installed ffi-1.16.3
    Successfully installed ethon-0.16.0
    Successfully installed typhoeus-1.4.0
    Successfully installed public_suffix-4.0.7
    Successfully installed fuzzy_match-2.0.4
    Successfully installed concurrent-ruby-1.2.2
    Successfully installed httpclient-2.8.3
    A new major version is available for Algolia! Please now use the https://rubygems.org/gems/algolia gem to get the latest features.
    Successfully installed algoliasearch-1.27.5
    Successfully installed addressable-2.8.5
    Successfully installed tzinfo-2.0.6
    Successfully installed i18n-1.14.1
    Successfully installed connection_pool-2.4.1
    Successfully installed activesupport-7.1.2
    Successfully installed cocoapods-core-1.14.2
    Successfully installed cocoapods-1.14.2
    Parsing documentation for nanaimo-0.3.0
    Installing ri documentation for nanaimo-0.3.0
    Parsing documentation for colored2-3.1.2
    Installing ri documentation for colored2-3.1.2
    Parsing documentation for claide-1.1.0
    Installing ri documentation for claide-1.1.0
    Parsing documentation for CFPropertyList-3.0.6
    Installing ri documentation for CFPropertyList-3.0.6
    Parsing documentation for atomos-0.1.3
    Installing ri documentation for atomos-0.1.3
    Parsing documentation for xcodeproj-1.23.0
    Installing ri documentation for xcodeproj-1.23.0
    Parsing documentation for ruby-macho-2.5.1
    Installing ri documentation for ruby-macho-2.5.1
    Parsing documentation for nap-1.1.0
    Installing ri documentation for nap-1.1.0
    Parsing documentation for molinillo-0.8.0
    Installing ri documentation for molinillo-0.8.0
    Parsing documentation for gh_inspector-1.1.3
    Installing ri documentation for gh_inspector-1.1.3
    Parsing documentation for fourflusher-2.3.1
    Installing ri documentation for fourflusher-2.3.1
    Parsing documentation for escape-0.0.4
    Installing ri documentation for escape-0.0.4
    Parsing documentation for cocoapods-try-1.2.0
    Installing ri documentation for cocoapods-try-1.2.0
    Parsing documentation for netrc-0.11.0
    Installing ri documentation for netrc-0.11.0
    Parsing documentation for cocoapods-trunk-1.6.0
    Installing ri documentation for cocoapods-trunk-1.6.0
    Parsing documentation for cocoapods-search-1.0.1
    Installing ri documentation for cocoapods-search-1.0.1
    Parsing documentation for cocoapods-plugins-1.0.0
    Installing ri documentation for cocoapods-plugins-1.0.0
    Parsing documentation for cocoapods-downloader-2.0
    Installing ri documentation for cocoapods-downloader-2.0
    Parsing documentation for cocoapods-deintegrate-1.0.5
    Installing ri documentation for cocoapods-deintegrate-1.0.5
    Parsing documentation for ffi-1.16.3
    Installing ri documentation for ffi-1.16.3
    Parsing documentation for ethon-0.16.0
    Installing ri documentation for ethon-0.16.0
    Parsing documentation for typhoeus-1.4.0
    Installing ri documentation for typhoeus-1.4.0
    Parsing documentation for public_suffix-4.0.7
    Installing ri documentation for public_suffix-4.0.7
    Parsing documentation for fuzzy_match-2.0.4
    Installing ri documentation for fuzzy_match-2.0.4
    Parsing documentation for concurrent-ruby-1.2.2
    Installing ri documentation for concurrent-ruby-1.2.2
    Parsing documentation for httpclient-2.8.3
    Installing ri documentation for httpclient-2.8.3
    Parsing documentation for algoliasearch-1.27.5
    Installing ri documentation for algoliasearch-1.27.5
    Parsing documentation for addressable-2.8.5
    Installing ri documentation for addressable-2.8.5
    Parsing documentation for tzinfo-2.0.6
    Installing ri documentation for tzinfo-2.0.6
    Parsing documentation for i18n-1.14.1
    Installing ri documentation for i18n-1.14.1
    Parsing documentation for connection_pool-2.4.1
    Installing ri documentation for connection_pool-2.4.1
    Parsing documentation for activesupport-7.1.2
    Couldn't find file to include 'activesupport/README.rdoc' from lib/active_support.rb
    Installing ri documentation for activesupport-7.1.2
    Parsing documentation for cocoapods-core-1.14.2
    Installing ri documentation for cocoapods-core-1.14.2
    Parsing documentation for cocoapods-1.14.2
    Installing ri documentation for cocoapods-1.14.2
    Done installing documentation for nanaimo, colored2, claide, CFPropertyList, atomos, xcodeproj, ruby-macho, nap, molinillo, gh_inspector, fourflusher, escape, cocoapods-try, netrc, cocoapods-trunk, cocoapods-search, cocoapods-plugins, cocoapods-downloader, cocoapods-deintegrate, ffi, ethon, typhoeus, public_suffix, fuzzy_match, concurrent-ruby, httpclient, algoliasearch, addressable, tzinfo, i18n, connection_pool, activesupport, cocoapods-core, cocoapods after 21 seconds
    34 gems installed
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    1. 查看pods源
    % pod repo
    
    master
    - Type: git (master)
    - URL:  https://git.coding.net/CocoaPods/Specs.git
    - Path: /Users/dev/.cocoapods/repos/master
    
    trunk
    - Type: CDN
    - URL:  https://cdn.cocoapods.org/
    - Path: /Users/dev/.cocoapods/repos/trunk
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    总结

    安装过程中出现了各种错误没能解决,最后全部卸载重装HomeBrew后安装一切顺利。

    参考

    https://brew.sh/

  • 相关阅读:
    C语言源代码系列-管理系统之机房机位预定系统
    你真的了解token续期嘛?
    arm-linux交叉编译Gstreamer
    End-to-End Lane Marker Detection via Row-wise Classification
    基于差值的图像超分辨率方法
    2023/9/21 -- C++/QT
    react 初体验
    论文阅读 Streaming Graph Neural Networks
    java实现http/https请求
    .NET 8新预览版本使用 Blazor 组件进行服务器端呈现
  • 原文地址:https://blog.csdn.net/libra_boy/article/details/134446824