365bet体育|www.635288com-365体育手机在线

热门关键词: 365bet体育,www.635288com,365体育手机在线

8.安装成功输出(再次安装就不需要再执行两次

2020-05-06 作者:365bet体育   |   浏览(158)

图片 1

2017年06月07日更新:

  • rvmruby环境配置
  • 将淘宝源移除,用ruby-china替换
  • 检查rvm环境,终端输入指令:
rvm -v
  • 输出(如果输出如下内容证明不存在rvm环境,如果存在请跳过此步骤)
-bash: rvm: command not found
  • 安装配置 rvm 环境
curl -L https://get.rvm.io | bash -s stable
  • 安装rvm成功的输出
% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed100 194 100 194 0 0 149 0 0:00:01 0:00:01 --:--:-- 149100 24062 100 24062 0 0 1156 0 0:00:20 0:00:20 --:--:-- 5092Downloading https://github.com/rvm/rvm/archive/1.29.1.tar.gzDownloading https://github.com/rvm/rvm/releases/download/1.29.1/1.29.1.tar.gz.asccurl:  Failed to connect to github-production-release-asset-2e65be.s3.amazonaws.com port 443: Operation timed outCould not download 'https://github.com/rvm/rvm/releases/download/1.29.1/1.29.1.tar.gz.asc'.curl returned status '7'.Installing RVM to /Users/wanghongqing/.rvm/Adding rvm PATH line to /Users/wanghongqing/.profile /Users/wanghongqing/.mkshrc /Users/wanghongqing/.bashrc /Users/wanghongqing/.zshrc.Adding rvm loading line to /Users/wanghongqing/.profile /Users/wanghongqing/.bash_profile /Users/wanghongqing/.zlogin.Installation of RVM in /Users/wanghongqing/.rvm/ is almost complete:* To start using RVM you need to run `source /Users/wanghongqing/.rvm/scripts/rvm`in all your open shell windows, in rare cases you need to reopen all shell windows.# hongqingWang,## 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

图片 2

如果是第一次安装,出现的结果是下面的样子

Installing RVM to /Users/wanghongqing/.rvm/ Adding rvm PATH line to /Users/wanghongqing/.profile /Users/wanghongqing/.mkshrc /Users/wanghongqing/.bashrc /Users/wanghongqing/.zshrc. Adding rvm loading line to /Users/wanghongqing/.profile /Users/wanghongqing/.bash_profile /Users/wanghongqing/.zlogin.Installation of RVM in /Users/wanghongqing/.rvm/ is almost complete: * To start using RVM you need to run `source /Users/wanghongqing/.rvm/scripts/rvm` in all your open shell windows, in rare cases you need to reopen all shell windows.wanghongqingdeMac-mini:~ wanghongqing$ 

图片 3

  • 重新载入rvm环境source ~/.rvm/scripts/rvm
  1. 再次检查rvm环境配置状态rvm -v

  2. rvm环境配置完毕rvm 1.29.1 by Michal Papis, Piotr Kuczynski, Wayne E. Seguin []

rvm 1.29.3  by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

*Tips:如果ruby的版本低于2.2.2,安装CocoaPods会报错,所以建议先升级ruby环境,建议升级到2.3.0以上版本。

  1. 查询当前ruby环境ruby -v

  2. 获取到当前版本号ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

  3. 查询已知的ruby环境rvm list known

  4. 输出查询结果# 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[.6][ruby-]2.3[.3][ruby-]2.4[.0]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[.26] jruby[-9.1.7.0] jruby-head # Rubinius rbx-1[.4.3] rbx-2.3[.0] rbx-2.4[.1] rbx-2[.5.8] rbx[-3.71] rbx-head # Opal opal # Minimalistic ruby implementation - ISO 30170:2012 mruby-1.0.0 mruby-1.1.0 mruby-1[.2.0] mruby[-head] # Ruby Enterprise Edition ree-1.8.6 ree[-1.8.7][-2012.02] # 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
    

图片 4

  1. 指定ruby版本进行更新rvm install 2.3.0

接下来要进行两次Enter确认,一次输入管理员密码

  • 5.1 第一次Enter确认Searching for binary rubies, this might take some time.No binary rubies available for: osx/10.12/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.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):图片 5
  • 5.2 第一次Enter确认后输出,再提示第二次Enter确认==> 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/sbin==> The following existing directories will have their owner set to wanghongqing:/usr/local/bin/usr/local/sbin==> The following existing directories will have their group set to admin:/usr/local/bin/usr/local/sbin==> The following new directories will be created:/usr/local/Cellar/usr/local/Homebrew/usr/local/Frameworks/usr/local/etc/usr/local/include/usr/local/lib/usr/local/opt/usr/local/share/usr/local/share/zsh/usr/local/share/zsh/site-functions/usr/local/var

    Press RETURN to continue or any other key to abort
    

图片 6

  • 5.3 提示输入管理员密码==> /usr/bin/sudo /bin/chmod u rwx /usr/local/bin /usr/local/sbinPassword:

    图片 7

6.输入管理员密码后进行安装ruby 2.3.0版本

==> /usr/bin/sudo /bin/chmod g rwx /usr/local/bin /usr/local/sbin==> /usr/bin/sudo /usr/sbin/chown wanghongqing /usr/local/bin /usr/local/sbin==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/sbin==> /usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/share /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/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions==> /usr/bin/sudo /usr/sbin/chown wanghongqing /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/share /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/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var==> /usr/bin/sudo /bin/mkdir -p /Users/wanghongqing/Library/Caches/Homebrew==> /usr/bin/sudo /bin/chmod g rwx /Users/wanghongqing/Library/Caches/Homebrew==> /usr/bin/sudo /usr/sbin/chown wanghongqing /Users/wanghongqing/Library/Caches/Homebrew==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew==> /usr/bin/sudo /bin/chmod g rwx /Library/Caches/Homebrew==> /usr/bin/sudo /usr/sbin/chown wanghongqing /Library/Caches/Homebrew==> Downloading and installing Homebrew...remote: Counting objects: 6228, done.remote: Compressing objects: 100% (3808/3808), done.remote: Total 6228 (delta 3554), reused 4119 (delta 2223), pack-reused 0Receiving objects: 100% (6228/6228), 3.55 MiB | 557.00 KiB/s, done.Resolving deltas: 100% (3554/3554), 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* [new tag] 1.0.7 -> 1.0.7* [new tag] 1.0.8 -> 1.0.8* [new tag] 1.0.9 -> 1.0.9* [new tag] 1.1.0 -> 1.1.0* [new tag] 1.1.1 -> 1.1.1* [new tag] 1.1.10 -> 1.1.10* [new tag] 1.1.11 -> 1.1.11* [new tag] 1.1.12 -> 1.1.12* [new tag] 1.1.13 -> 1.1.13* [new tag] 1.1.2 -> 1.1.2* [new tag] 1.1.3 -> 1.1.3* [new tag] 1.1.4 -> 1.1.4* [new tag] 1.1.5 -> 1.1.5* [new tag] 1.1.6 -> 1.1.6* [new tag] 1.1.7 -> 1.1.7* [new tag] 1.1.8 -> 1.1.8* [new tag] 1.1.9 -> 1.1.9* [new tag] 1.2.0 -> 1.2.0* [new tag] 1.2.1 -> 1.2.1HEAD is now at 1765062 Merge pull request #2700 from sjackman/env-std-linux==> Tapping homebrew/coreCloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...remote: Counting objects: 4427, done.remote: Compressing objects: 100% (4231/4231), done.remote: Total 4427 , reused 469 , pack-reused 0Receiving objects: 100% (4427/4427), 3.52 MiB | 182.00 KiB/s, done.Resolving deltas: 100% , done.Tapped 4230 formulae (4,470 files, 11MB)==> Cleaning up /Library/Caches/Homebrew...==> Migrating /Library/Caches/Homebrew to /Users/wanghongqing/Library/Caches/Homebrew...==> Deleting /Library/Caches/Homebrew...Already up-to-date.==> Installation successful!==> Homebrew has enabled anonymous aggregate user behaviour analytics.Read the analytics documentation (and how to opt-out) here:http://docs.brew.sh/Analytics.html==> Next steps:- Run `brew help` to get started- Further documentation:http://docs.brew.shInstalling requirements for osx.Updating system.........Installing required packages: autoconf, automake, libtool, pkg-config, coreutils, libyaml, readline, libksba, openssl..........Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.Requirements installation successful.Installing Ruby from source to: /Users/wanghongqing/.rvm/rubies/ruby-2.3.0, this may take a while depending on your cpu...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 CurrentDload Upload Total Spent Left Speed0 13.5M 0 81920 0 0 85 0 46:21:29 0:16:00 46:05:29 0curl:  SSLRead() return error -9806There was an error.Checking fallback: https://ftp.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2No fallback URL could be found, try increasing timeout with:echo "export rvm_max_time_flag=20" >> ~/.rvmrcThere has been an error fetching the ruby interpreter. Halting the installation.
  • 图片 8

此处我还没有查明到底是因为什么报错,但是我关闭Terminal以后,再次安装的时候就可以正常安装了。

7.重新执行安装命令

rvm install 2.3.0

Error running '__rvm_make -j 1',please read /Users/wanghongqing/.rvm/log/1506477257_ruby-2.3.0/make.logThere has been an error while running make. Halting the installation.

图片 9

8.安装成功输出(再次安装就不需要再执行两次Enter及输入管理员密码了)

Searching for binary rubies, this might take some time.No binary rubies available for: osx/10.12/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/wanghongqing/.rvm/rubies/ruby-2.3.0, this may take a while depending on your cpu...ruby-2.3.0 - #downloading ruby-2.3.0, this may take a while depending on your connection...** Resuming transfer from byte position 81920% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed100 13.4M 100 13.4M 0 0 27376 0 0:08:35 0:08:35 --:--:-- 37898ruby-2.3.0 - #extracting ruby-2.3.0 to /Users/wanghongqing/.rvm/src/ruby-2.3.0.-ruby-2.3.0 - #applying patch /Users/wanghongqing/.rvm/patches/ruby/changeset_r53419.diff.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..ruby-2.3.0 - #downloading rubygems-2.6.12% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed100 749k 100 749k 0 0 41534 0 0:00:18 0:00:18 --:--:-- 44241No checksum for downloaded archive, recording checksum in user configuration.ruby-2.3.0 - #extracting rubygems-2.6.12....ruby-2.3.0 - #removing old rubygems.........ruby-2.3.0 - #installing rubygems-2.6.12.........................ruby-2.3.0 - #gemset created /Users/wanghongqing/.rvm/gems/ruby-2.3.0@globalruby-2.3.0 - #importing gemset /Users/wanghongqing/.rvm/gemsets/global.gems....|ruby-2.3.0 - #generating global wrappers........ruby-2.3.0 - #gemset created /Users/wanghongqing/.rvm/gems/ruby-2.3.0ruby-2.3.0 - #importing gemsetfile /Users/wanghongqing/.rvm/gemsets/default.gems evaluated to empty gem listruby-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

图片 10

  • 检查ruby版本号
gem -v
  • 如果版本低于2.6.x建议升级(此处我的版本是2.6.12
2.6.12
  • 如需升级,执行以下命令
gem update --system

提示error没有权限更新

Updating rubygems-updateFetching: rubygems-update-2.6.13.gem ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

以管理员身份执行

sudo gem update --system

成功

Password:Updating rubygems-updateFetching: rubygems-update-2.6.13.gem Successfully installed rubygems-update-2.6.13Parsing documentation for rubygems-update-2.6.13Installing ri documentation for rubygems-update-2.6.13Installing darkfish documentation for rubygems-update-2.6.13Installing RubyGems 2.6.13RubyGems 2.6.13 installedParsing documentation for rubygems-2.6.13Installing ri documentation for rubygems-2.6.13=== 2.6.13 / 2017-08-27Security fixes:* Fix a DNS request hijacking vulnerability. Fix by Samuel Giddins.* Fix an ANSI escape sequence vulnerability. Fix by Evan Phoenix.* Fix a DOS vulernerability in the `query` command. Fix by Samuel Giddins.* Fix a vulnerability in the gem installer that allowed a malicious gem to overwrite arbitrary files. Fix by Samuel Giddins.=== 2.6.12 / 2017-04-30Bug fixes:* Fix test_self_find_files_with_gemfile to sort expected files. Pull request #1880 by Kazuaki Matsuo.* Fix issue for MinGW / MSYS2 builds and testing. Pull request #1879 by MSP-Greg.* Fix gem open to open highest version number rather than lowest. Pull request #1877 by Tim Pope.* Add a test for requiring a default spec as installed by the ruby installer. Pull request #1899 by Samuel Giddins.* Fix broken --exact parameter to gem command. Pull request #1873 by Jason Frey.* [Installer] Generate backwards-compatible binstubs. Pull request #1904 by Samuel Giddins.* Fix pre-existing source recognition on add action. Pull request #1883 by Jonathan Claudius.* Prevent negative IDs in output of #inspect. Pull request #1908 by Vít Ondruch.* Allow Gem.finish_resolve to respect already-activated specs. Pull request #1910 by Samuel Giddins.=== 2.6.11 / 2017-03-16Bug fixes:* Fixed broken tests on ruby-head. Pull request #1841 by SHIBATA Hiroshi.* Update vendored Molinillo to 0.5.7. Pull request #1859 by Samuel Giddins.* Avoid activating Ruby 2.5 default gems when possible. Pull request #1843 by Samuel Giddins.* Use improved resolver sorting algorithm. Pull request #1856 by Samuel Giddins.=== 2.6.10 / 2017-01-23Bug fixes:* Fix `require` calling the wrong `gem` method when it is overridden. Pull request #1822 by Samuel Giddins.=== 2.6.9 / 2017-01-20Bug fixes:* Allow initializing versions with empty strings. Pull request #1767 by Luis Sagastume.* Fix TypeError on 2.4. Pull request #1788 by Nobuyoshi Nakada.* Don't output mkmf.log message if compilation didn't fail. Pull request #1808 by Jeremy Evans.* Fixed broken links and overzealous URL encoding in gem server. Pull request #1809 by Nicole Orchard.* Update vendored Molinillo to 0.5.5. Pull request #1812 by Samuel Giddins.* RakeBuilder: avoid frozen string issue. Pull request #1819 by Olle Jonsson.=== 2.6.8 / 2016-10-29Bug fixes:* Improve SSL verification failure message. Pull request #1751 by Eric Hodel.* Ensure `to_spec` falls back on prerelease specs. Pull request #1755 by André Arko.* Update vendored Molinillo to 0.5.3. Pull request #1763 by Samuel Giddins.=== 2.6.7 / 2016-09-26Bug 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-22Bug 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-21Minor 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 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-26Minor 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-05Minor 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-12Bug 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-28Bug 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-26Minor 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.------------------------------------------------------------------------------RubyGems installed the following executables: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/gemRuby Interactive  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_methodIf 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
  • 检查ruby
gem sources -l
  • 检查结果
*** CURRENT SOURCES ***https://ruby.taobao.org/
  • 我这里用淘宝源替换过,如果没替换过应该是下面的
*** CURRENT SOURCES ***https://rubygems.org/

移除gem

gem sources --remove https://rubygems.org/

结果

https://rubygems.org/ removed from sources
  • 因为淘宝源已经停止维护,所以建议使用China ruby,所以移除原来的淘宝源
gem sources --remove https://ruby.taobao.org/

这里我执行这个命令,总报下面的错误

ERROR: While executing gem ... (Errno::EACCES)Permission denied @ rb_sysopen - /Users/wanghongqing/.gemrc

在网上找了很多办法都没解决

说法是:你是用普通用户,运行了系统上的 rvm,而无法去存取系统上的目录。但是我按照网上的方法并没有很好的解决。

而我的做法是以管理员的身份执行这句命令

sudo gem source --remove https://ruby.taobao.org/

就成功的移除了淘宝源

https://ruby.taobao.org/ removed from sources

图片 11

  • 添加ruby-china
gem source --add https://gems.ruby-china.org

如果遇到同样的问题,还是以管理员身份添加就好了

  • 终端执行命令,以管理员的身份安装
sudo gem install cocoapods
  1. 安装成功(出现gems installed证明安装成功)Fetching: nanaimo-0.2.3.gem Successfully installed nanaimo-0.2.3Fetching: colored2-3.1.2.gem Successfully installed colored2-3.1.2Fetching: claide-1.0.2.gem Successfully installed claide-1.0.2Fetching: CFPropertyList-2.3.5.gem Successfully installed CFPropertyList-2.3.5Fetching: xcodeproj-1.5.0.gem Successfully installed xcodeproj-1.5.0Fetching: ruby-macho-1.1.0.gem Successfully installed ruby-macho-1.1.0Fetching: nap-1.1.0.gem Successfully installed nap-1.1.0Fetching: molinillo-0.5.7.gem Successfully installed molinillo-0.5.7Fetching: gh_inspector-1.0.3.gem Successfully installed gh_inspector-1.0.3Fetching: fourflusher-2.0.1.gem Successfully installed fourflusher-2.0.1Fetching: escape-0.0.4.gem Successfully installed escape-0.0.4Fetching: cocoapods-try-1.1.0.gem Successfully installed cocoapods-try-1.1.0Fetching: netrc-0.7.8.gem Successfully installed netrc-0.7.8Fetching: cocoapods-trunk-1.2.0.gem Successfully installed cocoapods-trunk-1.2.0Fetching: cocoapods-stats-1.0.0.gem Successfully installed cocoapods-stats-1.0.0Fetching: cocoapods-search-1.0.0.gem Successfully installed cocoapods-search-1.0.0Fetching: cocoapods-plugins-1.0.0.gem Successfully installed cocoapods-plugins-1.0.0Fetching: cocoapods-downloader-1.1.3.gem Successfully installed cocoapods-downloader-1.1.3Fetching: cocoapods-deintegrate-1.0.1.gem Successfully installed cocoapods-deintegrate-1.0.1Fetching: fuzzy_match-2.0.4.gem Successfully installed fuzzy_match-2.0.4Fetching: thread_safe-0.3.6.gem Successfully installed thread_safe-0.3.6Fetching: tzinfo-1.2.3.gem Successfully installed tzinfo-1.2.3Fetching: i18n-0.8.4.gem Successfully installed i18n-0.8.4Fetching: activesupport-4.2.8.gem Successfully installed activesupport-4.2.8Fetching: cocoapods-core-1.2.1.gem Successfully installed cocoapods-core-1.2.1Fetching: cocoapods-1.2.1.gem Successfully installed cocoapods-1.2.1Parsing documentation for nanaimo-0.2.3Installing ri documentation for nanaimo-0.2.3Parsing documentation for colored2-3.1.2Installing ri documentation for colored2-3.1.2Parsing documentation for claide-1.0.2Installing ri documentation for claide-1.0.2Parsing documentation for CFPropertyList-2.3.5Installing ri documentation for CFPropertyList-2.3.5Parsing documentation for xcodeproj-1.5.0Installing ri documentation for xcodeproj-1.5.0Parsing documentation for ruby-macho-1.1.0Installing ri documentation for ruby-macho-1.1.0Parsing documentation for nap-1.1.0Installing ri documentation for nap-1.1.0Parsing documentation for molinillo-0.5.7Installing ri documentation for molinillo-0.5.7Parsing documentation for gh_inspector-1.0.3Installing ri documentation for gh_inspector-1.0.3Parsing documentation for fourflusher-2.0.1Installing ri documentation for fourflusher-2.0.1Parsing documentation for escape-0.0.4Installing ri documentation for escape-0.0.4Parsing documentation for cocoapods-try-1.1.0Installing ri documentation for cocoapods-try-1.1.0Parsing documentation for netrc-0.7.8Installing ri documentation for netrc-0.7.8Parsing documentation for cocoapods-trunk-1.2.0Installing ri documentation for cocoapods-trunk-1.2.0Parsing documentation for cocoapods-stats-1.0.0Installing ri documentation for cocoapods-stats-1.0.0Parsing documentation for cocoapods-search-1.0.0Installing ri documentation for cocoapods-search-1.0.0Parsing documentation for cocoapods-plugins-1.0.0Installing ri documentation for cocoapods-plugins-1.0.0Parsing documentation for cocoapods-downloader-1.1.3Installing ri documentation for cocoapods-downloader-1.1.3Parsing documentation for cocoapods-deintegrate-1.0.1Installing ri documentation for cocoapods-deintegrate-1.0.1Parsing documentation for fuzzy_match-2.0.4Installing ri documentation for fuzzy_match-2.0.4Parsing documentation for thread_safe-0.3.6Installing ri documentation for thread_safe-0.3.6Parsing documentation for tzinfo-1.2.3Installing ri documentation for tzinfo-1.2.3Parsing documentation for i18n-0.8.4Installing ri documentation for i18n-0.8.4Parsing documentation for activesupport-4.2.8Installing ri documentation for activesupport-4.2.8Parsing documentation for cocoapods-core-1.2.1Installing ri documentation for cocoapods-core-1.2.1Parsing documentation for cocoapods-1.2.1Installing ri documentation for cocoapods-1.2.1Done installing documentation for nanaimo, colored2, claide, CFPropertyList, xcodeproj, ruby-macho, nap, molinillo, gh_inspector, fourflusher, escape, cocoapods-try, netrc, cocoapods-trunk, cocoapods-stats, cocoapods-search, cocoapods-plugins, cocoapods-downloader, cocoapods-deintegrate, fuzzy_match, thread_safe, tzinfo, i18n, activesupport, cocoapods-core, cocoapods after 16 seconds26 gems installed

如果出现下面度问题

ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/fuzzy_match

更换成下面度安装命令

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

成功输出如下

ERROR: SSL verification error at depth 1: unable to get local issuer certificate ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted storeSuccessfully installed fuzzy_match-2.0.4Fetching: cocoapods-core-1.3.1.gem Successfully installed cocoapods-core-1.3.1Fetching: claide-1.0.2.gem Successfully installed claide-1.0.2Fetching: cocoapods-deintegrate-1.0.1.gem Successfully installed cocoapods-deintegrate-1.0.1Fetching: cocoapods-downloader-1.1.3.gem Successfully installed cocoapods-downloader-1.1.3Fetching: cocoapods-plugins-1.0.0.gem Successfully installed cocoapods-plugins-1.0.0Fetching: cocoapods-search-1.0.0.gem Successfully installed cocoapods-search-1.0.0Fetching: cocoapods-stats-1.0.0.gem Successfully installed cocoapods-stats-1.0.0Fetching: netrc-0.7.8.gem Successfully installed netrc-0.7.8Fetching: cocoapods-trunk-1.2.0.gem Successfully installed cocoapods-trunk-1.2.0Fetching: cocoapods-try-1.1.0.gem Successfully installed cocoapods-try-1.1.0Fetching: molinillo-0.5.7.gem Successfully installed molinillo-0.5.7Fetching: CFPropertyList-2.3.5.gem Successfully installed CFPropertyList-2.3.5Fetching: colored2-3.1.2.gem Successfully installed colored2-3.1.2Fetching: nanaimo-0.2.3.gem Successfully installed nanaimo-0.2.3Fetching: xcodeproj-1.5.2.gem Successfully installed xcodeproj-1.5.2Fetching: escape-0.0.4.gem Successfully installed escape-0.0.4Fetching: fourflusher-2.0.1.gem Successfully installed fourflusher-2.0.1Fetching: gh_inspector-1.0.3.gem Successfully installed gh_inspector-1.0.3Fetching: ruby-macho-1.1.0.gem Successfully installed ruby-macho-1.1.0Fetching: cocoapods-1.3.1.gem Successfully installed cocoapods-1.3.1Parsing documentation for fuzzy_match-2.0.4Installing ri documentation for fuzzy_match-2.0.4Parsing documentation for cocoapods-core-1.3.1Installing ri documentation for cocoapods-core-1.3.1Parsing documentation for claide-1.0.2Installing ri documentation for claide-1.0.2Parsing documentation for cocoapods-deintegrate-1.0.1Installing ri documentation for cocoapods-deintegrate-1.0.1Parsing documentation for cocoapods-downloader-1.1.3Installing ri documentation for cocoapods-downloader-1.1.3Parsing documentation for cocoapods-plugins-1.0.0Installing ri documentation for cocoapods-plugins-1.0.0Parsing documentation for cocoapods-search-1.0.0Installing ri documentation for cocoapods-search-1.0.0Parsing documentation for cocoapods-stats-1.0.0Installing ri documentation for cocoapods-stats-1.0.0Parsing documentation for netrc-0.7.8Installing ri documentation for netrc-0.7.8Parsing documentation for cocoapods-trunk-1.2.0Installing ri documentation for cocoapods-trunk-1.2.0Parsing documentation for cocoapods-try-1.1.0Installing ri documentation for cocoapods-try-1.1.0Parsing documentation for molinillo-0.5.7Installing ri documentation for molinillo-0.5.7Parsing documentation for CFPropertyList-2.3.5Installing ri documentation for CFPropertyList-2.3.5Parsing documentation for colored2-3.1.2Installing ri documentation for colored2-3.1.2Parsing documentation for nanaimo-0.2.3Installing ri documentation for nanaimo-0.2.3Parsing documentation for xcodeproj-1.5.2Installing ri documentation for xcodeproj-1.5.2Parsing documentation for escape-0.0.4Installing ri documentation for escape-0.0.4Parsing documentation for fourflusher-2.0.1Installing ri documentation for fourflusher-2.0.1Parsing documentation for gh_inspector-1.0.3Installing ri documentation for gh_inspector-1.0.3Parsing documentation for ruby-macho-1.1.0Installing ri documentation for ruby-macho-1.1.0Parsing documentation for cocoapods-1.3.1Installing ri documentation for cocoapods-1.3.121 gems installed
  • 终端输入指令
pod setup

安装完成以后的输出

Setting up CocoaPods master repo $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress Cloning into 'master'... remote: Counting objects: 1563147, done. remote: Compressing objects: 100% (3192/3192), done. remote: Total 1563147 (delta 2286), reused 2844 (delta 1169), pack-reused 1558582 Receiving objects: 100% (1563147/1563147), 428.32 MiB | 78.00 KiB/s, done. Resolving deltas: 100% (822273/822273), done. Checking out files: 100% (184860/184860), done.CocoaPods 1.4.0.beta.1 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.4.0.beta.1Setup completed
这里曾经我遇到过一个面试题,题目大概是:当执行pod setup时,实际上发生了什么?可惜当时我没有答上,现在补上,希望可以帮助到别人和自己。*

所有项目的Podspec文件都托管在 setup时,CocoaPods会将这些podspec索引文件更新到本地的~/.cocoapods/`目录下,这个索引文件比较大,有821.7M左右。所以第一次更新时会有点慢。如果安装 CocoaPods 时不执行此命令,在初次执行 pod intall 命令时,系统也会自动执行该指令(这个我并没有试过,只是网上有这种说法)

图片 12

  • 新建一个项目到桌面,并切换到该项目目录下

图片 13

  • 初始化项目,生成Podfile文件
pod init

图片 14

  • Xcode编辑Podfile文件

图片 15

  • 模糊搜索第三方框架
pod search afn

图片 16

如果之前的ruby环境配置不正确的话,搜索到可能会是这样的情况:

/Library/Ruby/Site/2.0.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)from /Library/Ruby/Site/2.0.0/rubygems.rb:278:in `activate_bin_path'from /usr/local/bin/pod:22:in `<main>'
  • 搜索afn的结果

图片 17

  • Podfile文件中添加第三方框架
pod 'AFNetworking'

图片 18

7.安装框架第三方框架AFNetworking(第一次使用时,可能会等待十几分钟的时间)

pod install
  • 图片 19

8.安装框架第三方框架,不更新本地索引,速度快

pod install --no-repo-update
  • 图片 20

10.CocoaPods 在执行pod installpod update时,会默认先更新一次podspec索引。使用--no-repo-update参数可以禁止其做索引更新操作。如下所示:

pod install --no-repo-updatepod update --no-repo-update

图片 21

11.删除第三方框架

  • Podfile文件中,删除对应第三方框架

    pod 'AFNetworking'
    
  • 然后

    pod update
    

当你执行pod install之后,除了 Podfile 外,CocoaPods 还会生成一个名为Podfile.lock的文件,Podfile.lock应该加入到版本控制里面,不应该把这个文件加入到.gitignore中。因为Podfile.lock会锁定当前各依赖库的版本,之后如果多次执行pod install不会更改版本,要pod update才会改Podfile.lock了。这样多人协作的时候,可以防止第三方库升级时造成大家各自的第三方库版本不一致。CocoaPods 的这篇 官方文档 也在What is a Podfile.lock一节中介绍了Podfile.lock的作用,并且指出:

This file should always be kept under version control.

摘自唐巧老师CocoaPods是将所有的依赖库都放到另一个名为Pods项目中,然后让主项目依赖Pods项目,这样,源码管理工作都从主项目移到了Pods项目中。发现的一些技术细节有:Pods 项目最终会编译成一个名为libPods.a的文件,主项目只需要依赖这个.a文件即可。对于资源文件,CocoaPods提供了一个名为Pods-resources.shbash脚本,该脚本在每次项目编译的时候都会执行,将第三方库的各种资源文件复制到目标目录中。CocoaPods通过一个名为Pods.xcconfig的文件来在编译时设置所有的依赖和参数。

本文由365bet体育发布于365bet体育,转载请注明出处:8.安装成功输出(再次安装就不需要再执行两次

关键词: 365bet注册送钱 iOS CocoaPods