mac安装指定版本的ruby_Mac Ruby 安装 更新于 20190802

在 Mac 中安装 Ruby 需要先安装好 RVM

RVM 是一个便捷的多版本 Ruby 环境的管理和切换工具 官网:https://rvm.io/

在终端控制台输入命令行:

$ curl -sSL https://get.rvm.io | bash -s stable // 之后按回车键

截止到目前 最新的版本是 rvm 1.29.10

如下所示:

:~ Mac $ curl -sSL https://get.rvm.io | bash -s stable

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

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

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

but no GPG software exists to validate it, skipping.

Installing RVM to /Users/admin/.rvm/

Adding rvm PATH line to /Users/admin/.profile /Users/admin/.mkshrc /Users/admin/.bashrc /Users/admin/.zshrc.

Adding rvm loading line to /Users/admin/.profile /Users/admin/.bash_profile /Users/admin/.zlogin.

Installation of RVM in /Users/admin/.rvm/ is almost complete:

* To start using RVM you need to run `source /Users/admin/.rvm/scripts/rvm`

in all your open shell windows, in rare cases you need to reopen all shell windows.

# admin,

#

# 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

等待一两分钟 成功安装好 RVM

1.2 然后 载入 RVM 环境

$ source ~/.rvm/scripts/rvm

1.3 修改 RVM 下载 Ruby 的源 到 Ruby China 的镜像 !

记住这个镜像 是 ruby-china.com 不是其他的

$ echo "ruby_url=https://cache.ruby-china.com/pub/ruby" > ~/.rvm/user/db

1.3.1 检查一下是否安装正确

$ rvm -v

// 如下所示:

Mac :~ admin $ source ~/.rvm/scripts/rvm

Mac :~ admin $ echo

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值