RVM:在 Mac OSX El Capitan 上安装最新版本的 ruby 失败
Posted
技术标签:
【中文标题】RVM:在 Mac OSX El Capitan 上安装最新版本的 ruby 失败【英文标题】:RVM: failure in installing latest version of ruby on Mac OSX El Capitan 【发布时间】:2015-10-12 00:32:52 【问题描述】:我是 Ruby 新手,默认情况下我的 Mac 上安装了 2.0.0
版本的 Ruby。我试图获取最新版本,并关注了这个问题:How to update Ruby to 1.9.x on Mac?,但即便如此,最新版本仍然是2.0.0
。我复制了一些我使用的终端命令:
Last login: Sun Oct 11 19:58:56 on console
Manish-MBP:~ manishgiri$ ruby -v
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
Manish-MBP:~ manishgiri$ \curl -L https://get.rvm.io | bash -s stable --ruby
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 102 0 0:00:01 0:00:01 --:--:-- 102
100 22721 100 22721 0 0 9052 0 0:00:02 0:00:02 --:--:-- 9052
Downloading https://github.com/rvm/rvm/archive/1.26.11.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc
Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc',
but no GPG software exists to validate it, skipping.
Installing RVM to /Users/manishgiri/.rvm/
Adding rvm PATH line to /Users/manishgiri/.profile /Users/manishgiri/.mkshrc /Users/manishgiri/.bashrc /Users/manishgiri/.zshrc.
Adding rvm loading line to /Users/manishgiri/.profile /Users/manishgiri/.bash_profile /Users/manishgiri/.zlogin.
Installation of RVM in /Users/manishgiri/.rvm/ is almost complete:
* To start using RVM you need to run `source /Users/manishgiri/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
# Manish-Giri,
#
# 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: http://rvm.io/help and https://twitter.com/rvm_io
rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.2.1.
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.......
Error running 'requirements_osx_brew_update_system ruby-2.2.1',
showing last 15 lines of /Users/manishgiri/.rvm/log/1444608144_ruby-2.2.1/update_system.log
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.'
++ /scripts/functions/logging : rvm_error() 115 > rvm_pretty_print stderr
++ /scripts/functions/logging : rvm_pretty_print() 73 > case "$rvm_pretty_print_flag:=auto" in
++ /scripts/functions/logging : rvm_pretty_print() 78 > case "$TERM:-dumb" in
++ /scripts/functions/logging : rvm_pretty_print() 81 > case "$1" in
++ /scripts/functions/logging : rvm_pretty_print() 83 > [[ -t 2 ]]
++ /scripts/functions/logging : rvm_pretty_print() 83 > return 1
++ /scripts/functions/logging : rvm_error() 117 > printf %b 'Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'
Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
++ /scripts/functions/requirements/osx_brew : requirements_osx_brew_update_system() 381 > return 1
Requirements installation failed with status: 1.
Manish-MBP:~ manishgiri$ brew update
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.
You should probably change the ownership and permissions of /usr/local
back to your user account.
sudo chown -R $(whoami):admin /usr/local
Manish-MBP:~ manishgiri$ sudo chown -R $(whoami):admin /usr/local
Password:
Manish-MBP:~ manishgiri$ ruby -v
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
Manish-MBP:~ manishgiri$
看来自制软件有问题,所以我决定更新它。我做了更改所有权和权限部分,并按照这个问题的说明 - How do I update Homebrew? 并执行了brew update
。我收到了Already upto date
回复。
接下来,我从第一个答案中尝试了rvm list known
,只是为了验证最新版本,然后我执行了rvm install current && rvm use current
。我收到了这样的回复:
Last login: Sun Oct 11 20:01:18 on ttys000
Manish-MBP:~ manishgiri$ 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[-p643]
[ruby-]2.1.4
[ruby-]2.1[.5]
[ruby-]2.2[.1]
[ruby-]2.2-head
ruby-head
# for forks use: rvm install ruby-head-<name> --url https://github.com/github/ruby.git --branch 2.1
# JRuby
jruby-1.6.8
jruby[-1.7.19]
jruby-head
jruby-9.0.0.0.pre1
# Rubinius
rbx-1.4.3
rbx-2.4.1
rbx[-2.5.2]
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
Manish-MBP:~ manishgiri$ rvm install current && rvm use current
system
Now using system ruby.
毕竟,我以为它会升级到2.2.3
,但是当我运行ruby -v
时,我仍然得到:ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
。
为什么更新失败?我在我的 Windows PC 上安装了 RubyInstaller,它使用 2.2.3
。
【问题讨论】:
那么当您执行 rvm install 2.2.3 时会发生什么? 【参考方案1】:尝试更新 Homebrew,退出终端,然后重新打开。然后 rvm install ruby-1.9.3-p551
还要确保将其设置为默认值。 rvm --default 使用 version #,退出终端,然后重新打开。
我偶然得到它。部分来自此 YouTube 视频:Setting Up Ruby [ Ruby on Rails from the Ground Up - 2/5 ]。剩下的就是用锋利的棍子戳它。
【讨论】:
以上是关于RVM:在 Mac OSX El Capitan 上安装最新版本的 ruby 失败的主要内容,如果未能解决你的问题,请参考以下文章
graphviz 错误:点:无法打开 hello.dot(OSX El Capitan)
制作 Mac OS X El Capitan 的U盘引导安装