Gem::InstallError: rubyzip requires Ruby version >= 2.4.

问题:

Gem::InstallError: rubyzip requires Ruby version >= 2.4.
An error occurred while installing rubyzip (2.0.0), and Bundler cannot continue.
Make sure that `gem install rubyzip -v '2.0.0'` succeeds before bundling.

原因: 本地ruby版本过低,需要更新ruby版本 >= 2.4

解决方案(mac),通过rvm更新ruby版本,更新完就可以啦~_~

1. 安装rvm,在命令行里执行以下步骤:

(1)curl -L get.rvm.io | bash -s stable

如果出现连接错误,检查网络,代理状态(git, yarn..)

ZZZs-Mac:~ rhino$ curl -L get.rvm.io | bash -s stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   194  100   194    0     0    103      0  0:00:01  0:00:01 --:--:--   103
100 24535  100 24535    0     0   7553      0  0:00:03  0:00:03 --:--:-- 56272
Downloading https://github.com/rvm/rvm/archive/1.29.9.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.tar.gz.asc
Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.tar.gz.asc',
but no GPG software exists to validate it, skipping.
Upgrading the RVM installation in /Users/rhino/.rvm/

如果出现curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to [raw.githubusercontent.com:443](raw.githubusercontent.com:443)

在etc/hosts上加上

199.232.68.133 raw.githubusercontent.com

该ip可以在 https://githubusercontent.com.ipaddress.com/raw.githubusercontent.com 查询得到

(2)source ~/.rvm/scripts/rvm

(3)echo "ruby_url=https://cache.ruby-china.org/pub/ruby" > ~/.rvm/user/db

(4)rvm -v

ZZZs-Mac:~ rhino$ rvm -v
rvm 1.29.9 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

2. 安装或者更新ruby(关闭本地yarn, git之类的代理),具体安装哪个版本可参考我的另一篇https://www.cnblogs.com/zwting/p/11814381.html

rvm install 2.6.0

ZZZs-Mac:~ rhino$ rvm install 2.6.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.14/x86_64/ruby-2.6.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................................................................-
Installing required packages: zlib..
==> Upgrading 4 outdated packages:
automake 1.15.1 -> 1.16.1_1
coreutils 8.28_1 -> 8.31
libyaml 0.1.7 -> 0.2.2
readline 7.0.3_1 -> 8.0.1
==> Upgrading readline
==> Downloading https://homebrew.bintray.com/bottles/readline-8.0.1.mojave.bottl
==> Downloading from https://akamai.bintray.com/3c/3c754391e9d243835811d128771ca
######################################################################## 100.0%
==> Pouring readline-8.0.1.mojave.bottle.tar.gz
==> Caveats
...

  

  

posted @ 2019-10-16 16:42  我是个神经病  阅读(3156)  评论(0编辑  收藏  举报