F自己安装CocoaPods流程

这篇博客记录了在Mac上安装CocoaPods时遇到的错误:由于当前Ruby版本为2.0.0,低于activesupport的要求。博主通过使用rvm安装了Ruby 2.2.2来解决此问题,成功安装了CocoaPods并验证了其版本。

Last login: Mon Oct 10 10:07:45 on ttys000

LdeiMac:~ L$ gem sources -l

*** CURRENT SOURCES ***


https://ruby.taobao.org/

https://gems.ruby-china.org/

LdeiMac:~ L$ sudo gem install cocoapods

Password:

ERROR:  Error installing cocoapods:

activesupport requires Ruby version >= 2.2.2.

LdeiMac:~ L$ ruby -v

ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

LdeiMac:~ L$ 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[.8]

[ruby-]2.2[.4]

[ruby-]2.3[.0]

[ruby-]2.2-head

ruby-head


# for forks use: rvm install ruby-head-<name> --url https://github.com/github/ruby.git --branch 2.2


# JRuby

jruby-1.6[.8]

jruby-1.7[.23]

jruby[-9.0.5.0]

jruby-head


# Rubinius

rbx-1[.4.3]

rbx-2.3[.0]

rbx-2.4[.1]

rbx[-2.5.8]

rbx-head


# Opal

opal


# Minimalistic ruby implementation - ISO 30170:2012

mruby[-head]


# Ruby Enterprise Edition

ree-1.8.6

ree[-1.8.7][-2012.02]


# GoRuby

goruby


# Topaz

topaz


# MagLev

maglev[-head]

maglev-1.0.0


# Mac OS X Snow Leopard Or Newer

macruby-0.10

macruby-0.11

macruby[-0.12]

macruby-nightly

macruby-head


# IronRuby

ironruby[-1.1.3]

ironruby-head

LdeiMac:~ L$ rvm install 2.2.2

Searching for binary rubies, this might take some time.

Found remote file https://rvm_io.global.ssl.fastly.net/binaries/osx/10.11/x86_64/ruby-2.2.2.tar.bz2

Checking requirements for osx.

About to install Homebrew, press `Enter` for default installation in `/usr/local`,

type new path if you wish custom Homebrew installation (the path needs to be writable for user)

==> 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

==> The following existing directories will be made group writable:

/usr/local/bin

/usr/local/etc

/usr/local/lib

/usr/local/sbin

/usr/local/share

/usr/local/share/doc

/usr/local/share/man

/usr/local/share/man/man1

==> The following existing directories will have their owner set to L:

/usr/local/bin

/usr/local/etc

/usr/local/lib

/usr/local/sbin

/usr/local/share

/usr/local/share/doc

/usr/local/share/man

/usr/local/share/man/man1

==> The following existing directories will have their group set to admin:

/usr/local/bin

/usr/local/lib

/usr/local/sbin

/usr/local/share

/usr/local/share/doc

/usr/local/share/man

/usr/local/share/man/man1

==> The following new directories will be created:

/usr/local/Cellar

/usr/local/Homebrew

/usr/local/Frameworks

/usr/local/opt

/usr/local/share/zsh

/usr/local/share/zsh/site-functions

/usr/local/var


Press RETURN to continue or any other key to abort

==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/etc /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1

Password:

==> /usr/bin/sudo /usr/sbin/chown L /usr/local/bin /usr/local/etc /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1

==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1

==> /usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var

==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var

==> /usr/bin/sudo /bin/chmod u+rwx share/zsh share/zsh/site-functions

==> /usr/bin/sudo /usr/sbin/chown L /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var

==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var

==> /usr/bin/sudo /bin/mkdir -p /Users/L/Library/Caches/Homebrew

==> /usr/bin/sudo /bin/chmod g+rwx /Users/L/Library/Caches/Homebrew

==> /usr/bin/sudo /usr/sbin/chown L /Users/L/Library/Caches/Homebrew

==> Downloading and installing Homebrew...

remote: Counting objects: 3376, done.

remote: Compressing objects: 100% (2395/2395), done.

remote: Total 3376 (delta 1544), reused 2156 (delta 847), pack-reused 0

Receiving objects: 100% (3376/3376), 2.17 MiB | 450.00 KiB/s, done.

Resolving deltas: 100% (1544/1544), done.

From https://github.com/Homebrew/brew

 * [new branch]      master     -> origin/master

 * [new tag]         0.1        -> 0.1

 * [new tag]         0.2        -> 0.2

 * [new tag]         0.3        -> 0.3

 * [new tag]         0.4        -> 0.4

 * [new tag]         0.5        -> 0.5

 * [new tag]         0.6        -> 0.6

 * [new tag]         0.7        -> 0.7

 * [new tag]         0.7.1      -> 0.7.1

 * [new tag]         0.8        -> 0.8

 * [new tag]         0.8.1      -> 0.8.1

 * [new tag]         0.9        -> 0.9

 * [new tag]         0.9.1      -> 0.9.1

 * [new tag]         0.9.2      -> 0.9.2

 * [new tag]         0.9.3      -> 0.9.3

 * [new tag]         0.9.4      -> 0.9.4

 * [new tag]         0.9.5      -> 0.9.5

 * [new tag]         0.9.8      -> 0.9.8

 * [new tag]         0.9.9      -> 0.9.9

 * [new tag]         1.0.0      -> 1.0.0

 * [new tag]         1.0.1      -> 1.0.1

 * [new tag]         1.0.2      -> 1.0.2

 * [new tag]         1.0.3      -> 1.0.3

 * [new tag]         1.0.4      -> 1.0.4

 * [new tag]         1.0.5      -> 1.0.5

 * [new tag]         1.0.6      -> 1.0.6

HEAD is now at 0546d90 Merge pull request #1251 from MikeMcQuaid/diagnostic-no-write-tmp

==> Homebrew has enabled anonymous aggregate user behaviour analytics

Read the analytics documentation (and how to opt-out) here:

  https://git.io/brew-analytics

==> Tapping homebrew/core

Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...

remote: Counting objects: 3733, done.

remote: Compressing objects: 100% (3623/3623), done.

remote: Total 3733 (delta 10), reused 358 (delta 1), pack-reused 0

Receiving objects: 100% (3733/3733), 3.00 MiB | 525.00 KiB/s, done.

Resolving deltas: 100% (10/10), done.

Checking connectivity... done.

Checking out files: 100% (3737/3737), done.

Tapped 3612 formulae (3,760 files, 9.3M)

Already up-to-date.

==> Installation successful!

==> Next steps

Run `brew help` to get started

Further documentation: https://git.io/brew-docs

Installing requirements for osx.

Updating system.....

Installing required packages: autoconf, automake, libtool, pkg-config, libyaml, readline, libksba, openssl.........

Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.

Requirements installation successful.

ruby-2.2.2 - #configure

ruby-2.2.2 - #download

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

  9 6854k    9  654k    0     0   1334      0  1:27:41  0:08:21  1:19:20 22205curl: (18) transfer closed with 6347400 bytes remaining to read

Partial file(18). Only a part of the file was transferred. Removing partial and re-trying.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 6854k  100 6854k    0     0   515k      0  0:00:13  0:00:13 --:--:--  670k

Checking fallback: ftp://rvm_io.global.ssl.fastly.net/binaries/osx/10.11/x86_64/ruby-2.2.2.tar.bz2?rvm=1.27.0

Checking fallback: https://www.mirrorservice.org/sites/rvm_io.global.ssl.fastly.net/binaries/osx/10.11/x86_64/ruby-2.2.2.tar.bz2?rvm=1.27.0

No fallback URL could be found, try increasing timeout with:


    echo "export rvm_max_time_flag=20" >> ~/.rvmrc


Downloading https://rvm_io.global.ssl.fastly.net/binaries/osx/10.11/x86_64/ruby-2.2.2.tar.bz2 failed.

Mounting remote ruby failed with status 2, trying to compile.

Checking requirements for osx.

Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.

Requirements installation successful.

Installing Ruby from source to: /Users/L/.rvm/rubies/ruby-2.2.2, this may take a while depending on your cpu(s)...

ruby-2.2.2 - #downloading ruby-2.2.2, this may take a while depending on your connection...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

  8 12.6M    8 1134k    0     0   1504      0  2:27:32  0:12:52  2:14:40     0curl: (56) SSLRead() return error -9806

There was an error(56).

Checking fallback: https://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.bz2

No fallback URL could be found, try increasing timeout with:


    echo "export rvm_max_time_flag=20" >> ~/.rvmrc


There has been an error fetching the ruby interpreter. Halting the installation.

LdeiMac:~ L$ pod seach AFN

-bash: pod: command not found

LdeiMac:~ L$ pod version

-bash: pod: command not found

LdeiMac:~ L$ pods --version

-bash: pods: command not found

LdeiMac:~ L$ pods -v

-bash: pods: command not found

LdeiMac:~ L$ gem sources -l

*** CURRENT SOURCES ***


https://ruby.taobao.org/

https://gems.ruby-china.org/

LdeiMac:~ L$ sudo gem install -n /usr/local/bin cocoapods

Password:

ERROR:  Error installing cocoapods:

activesupport requires Ruby version >= 2.2.2.

LdeiMac:~ L$ curl -L get.rvm.io | bash -s stable

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   184  100   184    0     0    259      0 --:--:-- --:--:-- --:--:--   259

100 22865  100 22865    0     0   3011      0  0:00:07  0:00:07 --:--:--  5341

Downloading https://github.com/rvm/rvm/archive/1.27.0.tar.gz

Downloading https://github.com/rvm/rvm/releases/download/1.27.0/1.27.0.tar.gz.asc

Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.27.0/1.27.0.tar.gz.asc',

but no GPG software exists to validate it, skipping.


Upgrading the RVM installation in /Users/L/.rvm/

    RVM PATH line found in /Users/L/.mkshrc /Users/L/.profile /Users/L/.bashrc /Users/L/.zshrc.

    RVM sourcing line found in /Users/L/.profile /Users/L/.bash_profile /Users/L/.zlogin.

Upgrade of RVM in /Users/L/.rvm/ is complete.


# L,

#

#   Thank you for using RVM!

#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!

#

# ~Wayne, Michal & team.


In case of problems: https://rvm.io/help and https://twitter.com/rvm_io


Upgrade Notes:


  * No new notes to display.


LdeiMac:~ L$ source ~/.bashrc

LdeiMac:~ L$ source ~/.bash_profile

LdeiMac:~ L$ rvm -v

rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

LdeiMac:~ L$ 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[.8]

[ruby-]2.2[.4]

[ruby-]2.3[.0]

[ruby-]2.2-head

ruby-head


# for forks use: rvm install ruby-head-<name> --url https://github.com/github/ruby.git --branch 2.2


# JRuby

jruby-1.6[.8]

jruby-1.7[.23]

jruby[-9.0.5.0]

jruby-head


# Rubinius

rbx-1[.4.3]

rbx-2.3[.0]

rbx-2.4[.1]

rbx[-2.5.8]

rbx-head


# Opal

opal


# Minimalistic ruby implementation - ISO 30170:2012

mruby[-head]


# Ruby Enterprise Edition

ree-1.8.6

ree[-1.8.7][-2012.02]


# GoRuby

goruby


# Topaz

topaz


# MagLev

maglev[-head]

maglev-1.0.0


# Mac OS X Snow Leopard Or Newer

macruby-0.10

macruby-0.11

macruby[-0.12]

macruby-nightly

macruby-head


# IronRuby

ironruby[-1.1.3]

ironruby-head

LdeiMac:~ L$ rvm install 2.3.0

Searching for binary rubies, this might take some time.

No binary rubies available for: osx/10.11/x86_64/ruby-2.3.0.

Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.

Checking requirements for osx.

Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.

Requirements installation successful.

Installing Ruby from source to: /Users/L/.rvm/rubies/ruby-2.3.0, this may take a while depending on your cpu(s)...

ruby-2.3.0 - #downloading ruby-2.3.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 13.5M  100 13.5M    0     0   311k      0  0:00:44  0:00:44 --:--:--  316k

ruby-2.3.0 - #extracting ruby-2.3.0 to /Users/L/.rvm/src/ruby-2.3.0....

ruby-2.3.0 - #configuring...........................................................

ruby-2.3.0 - #post-configuration.

ruby-2.3.0 - #compiling.............................................................

ruby-2.3.0 - #installing.........

ruby-2.3.0 - #making binaries executable..

Installed rubygems 2.5.1 is newer than 2.4.8 provided with installed ruby, skipping installation, use --force to force installation.

ruby-2.3.0 - #gemset created /Users/L/.rvm/gems/ruby-2.3.0@global

ruby-2.3.0 - #importing gemset /Users/L/.rvm/gemsets/global.gems...............................................

ruby-2.3.0 - #generating global wrappers........

ruby-2.3.0 - #gemset created /Users/L/.rvm/gems/ruby-2.3.0

ruby-2.3.0 - #importing gemsetfile /Users/L/.rvm/gemsets/default.gems evaluated to empty gem list

ruby-2.3.0 - #generating default wrappers........

ruby-2.3.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).

Install of ruby-2.3.0 - #complete 

Ruby was built without documentation, to build it run: rvm docs generate-ri

LdeiMac:~ L$ sudo gem install cocoapods

Password:

Fetching: i18n-0.7.0.gem (100%)

Successfully installed i18n-0.7.0

Fetching: thread_safe-0.3.5.gem (100%)

Successfully installed thread_safe-0.3.5

Fetching: tzinfo-1.2.2.gem (100%)

Successfully installed tzinfo-1.2.2

Fetching: concurrent-ruby-1.0.2.gem (100%)

Successfully installed concurrent-ruby-1.0.2

Fetching: activesupport-5.0.0.1.gem (100%)

Successfully installed activesupport-5.0.0.1

Fetching: nap-1.1.0.gem (100%)

Successfully installed nap-1.1.0

Fetching: fuzzy_match-2.0.4.gem (100%)

Successfully installed fuzzy_match-2.0.4

Fetching: cocoapods-core-1.0.1.gem (100%)

Successfully installed cocoapods-core-1.0.1

Fetching: claide-1.0.0.gem (100%)

Successfully installed claide-1.0.0

Fetching: cocoapods-deintegrate-1.0.1.gem (100%)

Successfully installed cocoapods-deintegrate-1.0.1

Fetching: cocoapods-downloader-1.1.1.gem (100%)

Successfully installed cocoapods-downloader-1.1.1

Fetching: cocoapods-plugins-1.0.0.gem (100%)

Successfully installed cocoapods-plugins-1.0.0

Fetching: cocoapods-search-1.0.0.gem (100%)

Successfully installed cocoapods-search-1.0.0

Fetching: cocoapods-stats-1.0.0.gem (100%)

Successfully installed cocoapods-stats-1.0.0

Fetching: netrc-0.7.8.gem (100%)

Successfully installed netrc-0.7.8

Fetching: cocoapods-trunk-1.0.0.gem (100%)

Successfully installed cocoapods-trunk-1.0.0

Fetching: cocoapods-try-1.1.0.gem (100%)

Successfully installed cocoapods-try-1.1.0

Fetching: molinillo-0.4.5.gem (100%)

Successfully installed molinillo-0.4.5

Fetching: colored-1.2.gem (100%)

Successfully installed colored-1.2

Fetching: xcodeproj-1.3.0.gem (100%)

Successfully installed xcodeproj-1.3.0

Fetching: escape-0.0.4.gem (100%)

Successfully installed escape-0.0.4

Fetching: fourflusher-0.3.2.gem (100%)

Successfully installed fourflusher-0.3.2

Fetching: cocoapods-1.0.1.gem (100%)

Successfully installed cocoapods-1.0.1

Parsing documentation for i18n-0.7.0

Installing ri documentation for i18n-0.7.0

Parsing documentation for thread_safe-0.3.5

Installing ri documentation for thread_safe-0.3.5

Parsing documentation for tzinfo-1.2.2

Installing ri documentation for tzinfo-1.2.2

Parsing documentation for concurrent-ruby-1.0.2

Installing ri documentation for concurrent-ruby-1.0.2

Parsing documentation for activesupport-5.0.0.1

Installing ri documentation for activesupport-5.0.0.1

Parsing documentation for nap-1.1.0

Installing ri documentation for nap-1.1.0

Parsing documentation for fuzzy_match-2.0.4

Installing ri documentation for fuzzy_match-2.0.4

Parsing documentation for cocoapods-core-1.0.1

Installing ri documentation for cocoapods-core-1.0.1

Parsing documentation for claide-1.0.0

Installing ri documentation for claide-1.0.0

Parsing documentation for cocoapods-deintegrate-1.0.1

Installing ri documentation for cocoapods-deintegrate-1.0.1

Parsing documentation for cocoapods-downloader-1.1.1

Installing ri documentation for cocoapods-downloader-1.1.1

Parsing documentation for cocoapods-plugins-1.0.0

Installing ri documentation for cocoapods-plugins-1.0.0

Parsing documentation for cocoapods-search-1.0.0

Installing ri documentation for cocoapods-search-1.0.0

Parsing documentation for cocoapods-stats-1.0.0

Installing ri documentation for cocoapods-stats-1.0.0

Parsing documentation for netrc-0.7.8

Installing ri documentation for netrc-0.7.8

Parsing documentation for cocoapods-trunk-1.0.0

Installing ri documentation for cocoapods-trunk-1.0.0

Parsing documentation for cocoapods-try-1.1.0

Installing ri documentation for cocoapods-try-1.1.0

Parsing documentation for molinillo-0.4.5

Installing ri documentation for molinillo-0.4.5

Parsing documentation for colored-1.2

Installing ri documentation for colored-1.2

Parsing documentation for xcodeproj-1.3.0

Installing ri documentation for xcodeproj-1.3.0

Parsing documentation for escape-0.0.4

Installing ri documentation for escape-0.0.4

Parsing documentation for fourflusher-0.3.2

Installing ri documentation for fourflusher-0.3.2

Parsing documentation for cocoapods-1.0.1

Installing ri documentation for cocoapods-1.0.1

Done installing documentation for i18n, thread_safe, tzinfo, concurrent-ruby, activesupport, nap, fuzzy_match, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-stats, netrc, cocoapods-trunk, cocoapods-try, molinillo, colored, xcodeproj, escape, fourflusher, cocoapods after 23 seconds

23 gems installed

LdeiMac:~ L$ sudo gem install -n /usr/local/bin cocoapods

Successfully installed cocoapods-1.0.1

Parsing documentation for cocoapods-1.0.1

Done installing documentation for cocoapods after 2 seconds

1 gem installed

LdeiMac:~ L$ pod setup

Setting up CocoaPods master repo


CocoaPods 1.1.0.rc.2 is available.

To update use: `sudo gem install cocoapods --pre`

[!] This is a test version we'd love you to try.


For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.1.0.rc.2


Setup completed

LdeiMac:~ L$ sudo gem update --system

Password:

Updating rubygems-update

Fetching: rubygems-update-2.6.7.gem (100%)

Successfully installed rubygems-update-2.6.7

Parsing documentation for rubygems-update-2.6.7

Installing ri documentation for rubygems-update-2.6.7

Installing darkfish documentation for rubygems-update-2.6.7

Done installing documentation for rubygems-update after 31 seconds

Parsing documentation for rubygems-update-2.6.7

Done installing documentation for rubygems-update after 0 seconds

Installing RubyGems 2.6.7

RubyGems 2.6.7 installed

Parsing documentation for rubygems-2.6.7

Installing ri documentation for rubygems-2.6.7


=== 2.6.7 / 2016-09-26


Bug fixes:


* Install native extensions in the correct location when using the

  `--user-install` flag. Pull request #1683 by Noah Kantrowitz.

* When calling `Gem.sources`, load sources from `configuration`

  if present, else use the default sources. Pull request #1699

  by Luis Sagastume.

* Fail gracefully when attempting to redirect without a Location.

  Pull request #1711 by Samuel Giddins.

* Update vendored Molinillo to 0.5.1. Pull request #1714 by

  Samuel Giddins.


=== 2.6.6 / 2016-06-22


Bug fixes:


* Sort installed versions to make sure we install the latest version when

  running `gem update --system`. As a one-time fix, run

  `gem update --system=2.6.6`. Pull request #1601 by David Radcliffe.


=== 2.6.5 / 2016-06-21


Minor enhancements:


* Support for unified Integer in Ruby 2.4. Pull request #1618

  by SHIBATA Hiroshi.

* Update vendored Molinillo to 0.5.0 for performance improvements.

  Pull request #1638 by Samuel Giddins.


Bug fixes:


* Raise an explicit error if Signer#sign is called with no certs. Pull

  request #1605 by Daniel Berger.

* Update `update_bundled_ca_certificates` utility script for directory

  nesting. Pull request #1583 by James Wen.

* Fix broken symlink support in tar writer (+ fix broken test). Pull

  request #1578 by Cezary Baginski.

* Remove extension directory before (re-)installing. Pull request #1576

  by Jeremy Hinegardner.

* Regenerate test CA certificates with appropriate extensions. Pull

  request #1611 by rhenium.

* Rubygems does not terminate on failed file lock when not superuser. Pull

  request #1582 by Ellen Marie Dash.

* Fix tar headers with a 101 character name. Pull request #1612 by Paweł

  Tomulik.

* Add Gem.platform_defaults to allow implementations to override defaults.

  Pull request #1644 by Charles Oliver Nutter.

* Run Bundler tests on TravisCI. Pull request #1650 by Samuel Giddins.


=== 2.6.4 / 2016-04-26


Minor enhancements:


* Use Gem::Util::NULL_DEVICE instead of hard coded strings. Pull request #1588

  by Chris Charabaruk.

* Use File.symlink on MS Windows if supported. Pull request #1418

  by Nobuyoshi Nakada.


Bug fixes:


* Redact uri password from error output when gem fetch fails. Pull request

  #1565 by Brian Fletcher.

* Suppress warnings. Pull request #1594 by Nobuyoshi Nakada.

* Escape user-supplied content served on web pages by `gem server` to avoid

  potential XSS vulnerabilities. Samuel Giddins.


=== 2.6.3 / 2016-04-05


Minor enhancements:


* Lazily calculate Gem::LoadError exception messages. Pull request #1550

  by Aaron Patterson.

* New fastly cert. Pull request #1548 by David Radcliffe.

* Organize and cleanup SSL certs. Pull request #1555 by James Wen.

* [RubyGems] Make deprecation message for paths= more helpful. Pull

  request #1562 by Samuel Giddins.

* Show default gems when using "gem list". Pull request #1570 by Luis

  Sagastume.


Bug fixes:


* Stub ordering should be consistent regardless of how cache is populated.

  Pull request #1552 by Aaron Patterson.

* Handle cases when the @@stubs variable contains non-stubs. Pull request

  #1558 by Per Lundberg.

* Fix test on Windows for inconsistent temp path. Pull request #1554 by

  Hiroshi Shirosaki.

* Fix `Gem.find_spec_for_exe` picks oldest gem. Pull request #1566 by

  Shinichi Maeshima.

* [Owner] Fallback to email and userid when owner email is missing. Pull

  request #1569 by Samuel Giddins.

* [Installer] Handle nil existing executable. Pull request #1561 by Samuel

  Giddins.

* Allow two digit version numbers in the tests. Pull request #1575 by unak.


=== 2.6.2 / 2016-03-12


Bug fixes:


* Fix wrong version of gem activation for bin stub. Pull request #1527 by

  Aaron Patterson.

* Speed up gem activation failures. Pull request #1539 by Aaron Patterson.

* Fix platform sorting in the resolver. Pull request #1542 by Samuel E.

  Giddins.

* Ensure we unlock the monitor even if try_activate throws. Pull request

  #1538 by Charles Oliver Nutter.



=== 2.6.1 / 2016-02-28


Bug fixes:


* Ensure `default_path` and `home` are set for paths. Pull request #1513

  by Aaron Patterson.

* Restore but deprecate support for Array values on `Gem.paths=`. Pull

  request #1514 by Aaron Patterson.

* Fix invalid gem file preventing gem install from working. Pull request

  #1499 by Luis Sagastume.


=== 2.6.0 / 2016-02-26


Minor enhancements:


* RubyGems now defaults the `gem push` to the gem's "allowed_push_host"

  metadata setting.  Pull request #1486 by Josh Lane.

* Update bundled Molinillo to 0.4.3. Pull request #1493 by Samuel E. Giddins.

* Add version option to gem open command. Pull request #1483 by Hrvoje

  Šimić.

* Feature/add silent flag. Pull request #1455 by Luis Sagastume.

* Allow specifying gem requirements via env variables. Pull request #1472

  by Samuel E. Giddins.


Bug fixes:


* RubyGems now stores `gem push` credentials under the host you signed-in for.

  Pull request #1485 by Josh Lane.

* Move `coding` location to first line. Pull request #1471 by SHIBATA

  Hiroshi.

* [PathSupport] Handle a regexp path separator. Pull request #1469 by

  Samuel E. Giddins.

* Clean up the PathSupport object. Pull request #1094 by Aaron Patterson.

* Join with File::PATH_SEPARATOR in Gem.use_paths. Pull request #1476 by

  Samuel E. Giddins.

* Handle when the gem home and gem path arent set in the config file. Pull

  request #1478 by Samuel E. Giddins.

* Terminate TimeoutHandler. Pull request #1479 by Nobuyoshi Nakada.

* Remove redundant cache. Pull request #1482 by Eileen M. Uchitelle.

* Freeze `Gem::Version@segments` instance variable. Pull request #1487 by

  Ben Dean.

* Gem cleanup is trying to uninstall gems outside GEM_HOME and reporting

  an error after it tries. Pull request #1353 by Luis Sagastume.

* Avoid duplicated sources. Pull request #1489 by Luis Sagastume.

* Better description for quiet flag. Pull request #1491 by Luis Sagastume.

* Raise error if find_by_name returns with nil. Pull request #1494 by

  Zoltán Hegedüs.

* Find_files only from loaded_gems when using gemdeps. Pull request #1277

  by Michal Papis.


=== 2.5.2 / 2016-01-31


Bug fixes:


* Fix memoization of Gem::Version#prerelease? Pull request #1125 by Matijs van

  Zuijlen.

* Handle trailing colons in GEM_PATH, by Damien Robert.

* Improve the Gemfile `gemspec` method, fixing #1204 and #1033. Pull request

  #1276 by Michael Papis.

* Warn only once when a gemspec license is invalid. Pull request #1414 by Samuel

  E. Giddins.

* Check for exact constants before using them, fixing Ruby bug #11940. Pull

  request #1438 by Nobuyoshi Nakada.

* Fix building C extensions on Ruby 1.9.x on Windows. Pull request #1453 by Marie

  Markwell.

* Handle symlinks containing ".." correctly. Pull request #1457 by Samuel E.

  Giddins.


Minor enhancements:


* Add `--no-rc` flag, which skips loading `.gemrc`. Pull request #1329 by Luis

  Sagastume.

* Allow basic auth to be excluded from `allowed_push_host`. By Josh Lane.

* Add `gem list --exact`, which finds gems by string match instead of regex. Pull

  request #1344 by Luis Sagastume.

* Suggest alternatives when gem license is unknown. Pull request #1443 by Samuel

  E. Giddins.

* Print a useful error if a binstub expects a newer version of a gem than is

  installed. Pull request #1407 by Samuel E. Giddins.

* Allow the (supported) s3:// scheme to be used with `--source`. Pull request

  #1416 by Dave Adams.

* Add `--[no-]post-install-message` to `install` and `update`. Pull request #1162

  by Josef Šimánek.

* Add `--host` option to `yank`, providing symmetry with `pull`. Pull request

  #1361 by Mike Virata-Stone.

* Update bundled Molinillo to 0.4.1. Pull request #1452 by Samuel E. Giddins.

* Allow calling `build` without '.gemspec'. Pull request #1454 by Stephen

  Blackstone.

* Add support for `source` option on gems in Gemfile. Pull request #1355 by

  Michael Papis.

* Function correctly when string literals are frozen on Ruby 2.3. Pull request

  #1408 by Samuel E. Giddins.


=== 2.5.1 / 2015-12-10


Bug fixes:


* Ensure platform sorting only uses strings. Affected binary installs on Windows.

  Issue #1369 reported by Ryan Atball (among others).

  Pull request #1375 by Samuel E. Giddins.

* Revert PR #1332. Unable to reproduce, and nil should be impossible.

* Gem::Specification#to_fullpath now returns .rb extensions when such a file

  exists.  Pull request #1114 by y-yagi.

* RubyGems now handles Net::HTTPFatalError instead of crashing.  Pull

  request #1314 by Samuel E. Giddins.

* Updated bundled Molinillo to 0.4.0.  Pull request #1322, #1396 by Samuel E.

  Giddins.

* Improved performance of spec loading by reducing likelihood of loading the

  complete specification.  Pull request #1373 by Aaron Patterson.

* Improved caching of requirable files  Pull request #1377 by Aaron Patterson.

* Fixed activation of gems with development dependencies.  Pull request #1388

  by Samuel E. Giddins.

* RubyGems now uses the same Molinillo vendoring strategy as Bundler.  Pull

  request #1397 by Samuel E. Giddins.

* Fixed documentation of Gem::Requirement.parse.  Pull request #1398 by

  Juanito Fatas.

* RubyGems no longer warns when a prerelease gem has prerelease dependencies.

  Pull request #1399 by Samuel E. Giddins.

* Fixed Gem::Version documentation example.  Pull request #1401 by Guilherme

  Goettems Schneider.

* Updated documentation links to https://.  Pull request #1404 by Suriyaa

  Kudo.

* Fixed double word typo.  Pull request #1411 by Jake Worth.



------------------------------------------------------------------------------


RubyGems installed the following executables:

/Users/L/.rvm/rubies/ruby-2.3.0/bin/gem


Ruby Interactive (ri) documentation was installed. ri is kind of like man 

pages for ruby libraries. You may access it like this:

  ri Classname

  ri Classname.class_method

  ri Classname#instance_method

If you do not wish to install this documentation in the future, use the

--no-document flag, or set it as the default in your ~/.gemrc file. See

'gem help env' for details.


RubyGems system software updated

LdeiMac:~ L$ pod --version

1.0.1

LdeiMac:~ L$ 


<think>我们正在处理一个ReactNative iOS项目的依赖管理迁移:从CocoaPods到Swift PackageManager (SPM)。根据引用内容,我们知道Flutter等框架也在向SPM迁移[^1][^2],这是一个趋势。同时,引用[3]提到在ReactNative项目中忽略CocoaPods的目录(/ios/Pods/)以及使用自动链接(Autolinking)的步骤。迁移步骤需要结合ReactNative项目的特殊性。注意:React Native0.60及以上版本支持自动链接(Autolinking),这可以简化原生模块的链接过程。但是,SPM的迁移需要手动处理。以下是迁移步骤:1.**评估项目可行性**:-检查项目中使用的原生模块(包括第三方库)是否支持SPM。可以通过查看库的文档或GitHub仓库确认。-注意:React Native本身的核心库是否支持SPM?目前ReactNative官方还没有完全迁移到SPM,所以部分核心依赖可能还需要CocoaPods。因此,迁移可能是部分迁移(即部分依赖使用SPM,部分保留CocoaPods)或者等待ReactNative官方支持。2. **创建Package.swift**:-在iOS项目目录(通常是`ios`目录)下创建`Package.swift`文件。-示例内容:```swift//swift-tools-version:5.7importPackageDescriptionlet package= Package(name:"YourProject",platforms: [.iOS(.v12)],products:[.library(name:"YourProject",targets:["YourProject"])],dependencies: [//在这里添加SPM依赖.package(url:"https://github.com/Alamofire/Alamofire.git", from: "5.6.0")],targets: [.target(name: "YourProject",dependencies:[//目标依赖的SPM包"Alamofire",//如果有其他本地模块,也可以在这里添加],path:".",sources: ["YourProject"],resources:[.process("Resources")])])```-注意:需要根据项目结构调整`path`和`sources`参数。3. **迁移依赖项**:-对于每个要迁移的依赖,在`Package.swift`的`dependencies`数组中添加对应的SPM包。-在`target`的`dependencies`数组中添加包名。-移除`Podfile`中对应的条目。4. **处理ReactNative的自动链接**:-ReactNative的自动链接是针对CocoaPods和`react-native link`设计的。对于SPM,目前React Native并没有内置支持。因此,我们需要手动链接:-在Xcode中,通过`File> AddPackages...`添加SPM包。-确保这些包被链接到你的主应用Target。-对于ReactNative原生模块(即使用`react-native`命令安装的模块),如果它们提供了SPM支持,则可以通过SPM添加;否则,可能需要保留CocoaPods或等待更新。5.**移除CocoaPods**:-删除`Podfile`、`Podfile.lock`和`Pods`目录。-删除`xcworkspace`文件。-更新`.gitignore`文件,移除对`Pods`目录和`xcworkspace`的忽略(因为不再需要),或者保留以防回退。-注意:引用[3]中提到了在.gitignore中忽略`/ios/Pods/`,迁移后可以继续忽略,因为我们删除了该目录。6. **修改Xcode项目配置**:-打开`.xcodeproj`(不是`.xcworkspace`)。-在项目的`BuildSettings`中,确保`Framework SearchPaths`和`HeaderSearch Paths`中不再包含CocoaPods的路径。-在`Build Phases`中,移除`[CP]`开头的脚本(这些是CocoaPods的脚本)。7. **测试**:-运行`poddeintegrate`(如果还没有完全移除CocoaPods痕迹)和`podclean`(清理CocoaPods缓存)。-在Xcode中,清理构建文件夹(`Command+Shift+K`),然后尝试构建项目。-运行ReactNative应用:`npxreact-nativerun-ios`。8.**注意事项**:-**部分迁移**:由于React Native本身可能还依赖CocoaPods,你可能无法完全移除CocoaPods。在这种情况下,可以只将部分依赖迁移到SPM,而保留ReactNative所需的CocoaPods依赖。具体来说,ReactNative的核心库(如`React`、`React-Core`等)目前还是通过CocoaPods管理的,所以不能完全删除Podfile。因此,迁移策略是:将第三方依赖迁移到SPM,而保留React Native相关的CocoaPods依赖。-**混合管理**:在同一个项目中同时使用CocoaPods和SPM是可能的,但需要谨慎。在Xcode11以后,可以在Podfile中使用`use_frameworks!:linkage =>:static`,并且通过`install!`方法中的`generate_multiple_pod_projects`和`incremental_installation`选项来改善兼容性。同时,可以在Podfile中引入SPM的包(通过`pod`命令引入本地路径的SPM包,但这并不是标准做法)。但为了简化,我们尽量将可迁移的依赖迁移到SPM,只留下必须用CocoaPods的依赖。9. **React Native0.60+的自动链接**:-自动链接仍然会处理通过CocoaPods安装的ReactNative模块。对于SPM,自动链接不会起作用。因此,对于使用SPM的ReactNative原生模块,需要手动在Xcode中链接,并可能需要修改`package.json`中的配置(目前没有标准方式)。由于React Native官方尚未完全支持SPM,迁移可能会遇到挑战。建议关注ReactNative官方动态,等待他们对SPM的支持。总结步骤:1.创建`Package.swift`并添加SPM依赖。2.移除Podfile中已迁移的依赖。3.使用Xcode手动添加SPM包。4.清理CocoaPods文件(但保留React Native核心所需的Podfile,除非官方支持SPM)。5.测试。注意:目前完全迁移可能不现实,因为React Native本身还依赖CocoaPods。因此,我们只能迁移那些提供SPM支持的第三方原生模块,而React Native核心库仍然通过CocoaPods管理。相关问题:1.React Native项目迁移到SPM后,如何管理ReactNative核心库的依赖?2.在混合使用CocoaPods和SPM的React Native项目中,如何解决潜在的冲突?3.如何为React Native原生模块添加SPM支持?4.迁移到SPM后,如何优化iOS构建时间?</think>### React Native iOS 项目迁移到 Swift Package Manager 的完整指南 根据引用内容,Flutter/React Native 等框架正逐步迁移到 SPM[^1][^2],这是 Apple 推动 Swift 生态的战略举措。以下是针对 React Native iOS 项目的迁移方案: --- #### 迁移步骤(结合 React Native 特性) 1. **评估兼容性** - 检查 `ios/Podfile` 中的依赖: ```bash cd ios && pod install --verbose ``` - 使用 `spmready` 扫描: ```bash gem install spmready spmready analyze --path=ios ``` - 重点关注 React Native 核心库(如 `React-Core`)的 SPM 支持状态(引用[2]) 2. **创建 Package.swift** 在 `ios/` 目录创建文件: ```swift // swift-tools-version:5.7 import PackageDescription let package = Package( name: "YourApp", platforms: [.iOS(.v12)], products: [.library(name: "MainApp", targets: ["MainApp"])], dependencies: [ // React Native 核心库(示例) .package(url: "https://github.com/facebook/react-native.git", from: "0.71.0"), // 其他 SPM 依赖 .package(url: "https://github.com/Alamofire/Alamofire.git", exact: "5.6.1") ], targets: [ .target( name: "MainApp", dependencies: [ .product(name: "React-Core", package: "react-native"), "Alamofire" ], path: ".", exclude: ["Podfile"], // 排除 CocoaPods 文件 resources: [.process("Assets")] ) ] ) ``` 3. **处理 React Native 自动链接**(引用[3]) - 保留 `ios/YourApp.xcodeproj/project.pbxproj` 中的自动链接配置: ```diff OTHER_LDFLAGS = ( "$(inherited)", + -lc++, -ObjC, - -l"Pods-YourApp" // 移除 CocoaPods 链接 ); ``` - 在 Build Settings 中添加: ``` SWIFT_INCLUDE_PATHS = $(SRCROOT)/../node_modules ``` 4. **迁移依赖策略** | 依赖类型 | 处理方案 | |----------------|----------------------------------| | 纯 Swift 库 | 直接替换为 SPM 等效库 | | Objective-C 库 | 创建本地 SPM 封装 | | RN 原生模块 | 保持 CocoaPods 直到官方支持 SPM | 5. **清理 CocoaPods** ```bash # 在 ios/ 目录执行 pod deintegrate rm -rf Pods Podfile.lock YourApp.xcworkspace ``` 更新 `.gitignore`(引用[3]): ```gitignore # 移除 CocoaPods 忽略项 # /ios/Pods/ ``` 6. **Xcode 配置** - 打开 `YourApp.xcodeproj`(非 workspace) - 删除所有 `Pods-*.framework` 引用 - 通过 **File > Add Packages...** 添加 SPM 依赖 --- #### 关键注意事项 1. **混合管理过渡期** - 暂时保留 React Native 核心的 CocoaPods 依赖(如 `Flipper`),逐步迁移 - 使用 `require_relative` 在 Podfile 中引用 SPM 包(实验性): ```ruby target 'YourApp' do use_frameworks! :linkage => :static require_relative '../Package.swift' # 实验性集成 end ``` 2. **资源文件处理** React Native 资源需改用 `Bundle.module`: ```swift // 替换 [[NSBundle mainBundle] pathForResource...] let path = Bundle.module.path(forResource: "icon", ofType: "png") ``` 3. **性能优化** ```bash # 启用 SPM 二进制依赖(Xcode 14+) swift package --allow-writing-to-package-directory resolve ``` --- #### 验证流程 ```mermaid graph LR A[构建测试] --> B{是否报错?} B -->|是| C[检查SPM依赖版本] B -->|否| D[运行RN应用] C --> E[更新Package.swift] D --> F[完整功能测试] F --> G[提交gitignore变更] ``` > **重要提示**: > - 优先迁移非核心依赖(如 Alamofire),逐步替换 RN 相关库 > - 关注 React Native 官方 SPM 迁移进度[^2] > - 使用 Git 分支进行实验性迁移 --- ### 相关问题 1. React Native 项目迁移到 SPM 后,如何管理 `react-native link` 自动链接的原生模块? 2. 在混合使用 CocoaPods 和 SPM 的过渡期,如何解决符号冲突问题? 3. Swift Package Manager 是否支持 React Native 的 Hermes 引擎集成? 4. 如何为 React Native 原生模块创建 SPM 兼容的封装包?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值