步骤1 - 安装 RVM

RVM 是干什么的这里就不解释了,后面你将会慢慢搞明确。

    $ curl -L https://get.rvm.io | bash -s stable

期间可能会问你sudo管理员password。这里可能须要等待一段时间后就能够安装成功好 RVM。

案例信息例如以下:

lihuifengdeMacBook-Pro:~ lihuifeng$ curl -L https://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      8      0  0:00:23  0:00:21  0:00:02     8
100 22817  100 22817    0     0    523      0  0:00:43  0:00:43 --:--:--  1056
Downloading https://github.com/wayneeseguin/rvm/archive/1.26.10.tar.gz
Downloading https://github.com/wayneeseguin/rvm/releases/download/1.26.10/1.26.10.tar.gz.asc
Found PGP signature at: 'https://github.com/wayneeseguin/rvm/releases/download/1.26.10/1.26.10.tar.gz.asc',
but no GPG software exists to validate it, skipping.

Upgrading the RVM installation in /Users/lihuifeng/.rvm/
    RVM PATH line found in /Users/lihuifeng/.profile /Users/lihuifeng/.bashrc /Users/lihuifeng/.zshrc.
    RVM sourcing line found in /Users/lihuifeng/.bash_profile /Users/lihuifeng/.zlogin.
Upgrade of RVM in /Users/lihuifeng/.rvm/ is complete.

# lihuifeng,
#
#   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

Upgrade Notes:

  * No new notes to display.

--这里就表示已经安装成功了--

然后,加载 RVM 环境

    $ source ~/.rvm/scripts/rvm

检查一下是否安装正确 :输入命令   rvm -v 。假设正确会列出RVM版本号 例如以下所看到的:

    $ rvm -v
A RVM version 1.26.10 (latest) is installed yet 1.25.28 (stable) is loaded.
Please do one of the following:
  * 'rvm reload'
  * open a new shell
  * 'echo rvm_auto_reload_flag=1 >> ~/.rvmrc' # for auto reload with msg.
  * 'echo rvm_auto_reload_flag=2 >> ~/.rvmrc' # for silent auto reload.

步骤2 - 用 RVM 安装 Ruby 环境

  输入命令  $ rvm install 2.0.0

    $ rvm install 2.0.0

相同继续等待漫长的下载,编译过程,完毕以后就安装好了。

A RVM version 1.26.10 (latest) is installed yet 1.25.28 (stable) is loaded.
Please do one of the following:
  * 'rvm reload'
  * open a new shell
  * 'echo rvm_auto_reload_flag=1 >> ~/.rvmrc' # for auto reload with msg.
  * 'echo rvm_auto_reload_flag=2 >> ~/.rvmrc' # for silent auto reload.

步骤3 - 设置 Ruby 版本号

RVM 装好以后,须要运行以下的命令将指定版本号的 Ruby 设置为系统默认版本号

    $ rvm 2.0.0 --default

相同。也能够用其它版本号号。前提是你实用 rvm install 安装过那个版本号

測试是否正确

 lihuifengdeMacBook-Pro:~ lihuifeng$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-darwin13.1.0]
lihuifengdeMacBook-Pro:~ lihuifeng$ gem -v
2.2.2 这有可能是由于Ruby的默认源使用的是cocoapods.org。国内訪问这个网址有时候会有问题,网上的一种解决方式是将远替换成淘宝的。替换方式例如以下:
   $gem source -r https://rubygems.org/
    $ gem source -a https://ruby.taobao.org lihuifengdeMacBook-Pro:~ lihuifeng$ gem source -r https://rubygems.org/
https://rubygems.org/ removed from sources
lihuifengdeMacBook-Pro:~ lihuifeng$ gem source -a https://ruby.taobao.org
https://ruby.taobao.org added to sources

 要想验证是否替换成功了,能够运行:

    $ gem sources -l  

正常的输出结果:

lihuifengdeMacBook-Pro:~ lihuifeng$ gem sources -l
*** CURRENT SOURCES ***

https://ruby.taobao.org

这里就表示已经把Ruby环境成功的安装到了Mac 上了。

Mac 下安装Ruby环境的更多相关文章

  1. Mac 下安装Ruby环境(转)

    步骤1 - 安装 RVM RVM 是干什么的这里就不解释了,后面你将会慢慢搞明白. $ curl -L https://get.rvm.io | bash -s stable 期间可能会问你sudo管 ...

  2. Mac 下安装 ruby 环境解决 brew 安装 yarn 问题

    在brew安装yarn提示 ruby的版本过低.在网上搜了一下发现 1. mac下自带的ruby 在 system 目录下 2. 其实可以用brew安装一个ruby brew install ruby ...

  3. linux系统下安装ruby环境

    1. 移除现有 Ruby 默认源 输入以下指令 $gem sources --remove https://rubygems.org/ 2. 使用新的源 输入以下指令 $gem sources -a  ...

  4. mac下升级ruby环境版本

    在ios开发中会经常使用到cocoapods来管理第三方框架,在安装cocoapods的时候会涉及到ruby环境,有时候会因为版本过低会导致安装失败,本文主要讲一下如何升级ruby环境 安装rvm,r ...

  5. mac下安装libpng环境

    用go写一个爬虫工具时需要使用一个go的库,而这个库有需要使用libpng库,不然编译就会提示说 png.h找不到等之类的信息,于是想到应该和windows一样需要安装gcc环境,然后让gcc里安装l ...

  6. linux下安装ruby环境

    安装步骤: ruby的shell叫irb,我们可以输入irb -v查看下irb的版本号 1.安装ruby解释器shell: yum install ruby-irb -y Installed: rub ...

  7. Mac 下安装ruby,以及CocoaPods安装以及使用网摘

    ruby安装网址:https://ruby-china.org/wiki/install_ruby_guide CocoaPods安装和使用教程地址:http://code4app.com/artic ...

  8. Mac下安装cocos2d-x环境

    安装后xcode之后,下载cocos2dx压缩包,解压 通过中断cd到cocos2dx文件夹内 输入下行命令 sudo ./install-templates-xcode.sh 执行成功后打开xcod ...

  9. 转-MAC 下安装PHONEGAP开发环境

    来自:http://jinzhe.net/post/8.html 什么是Phonegap呢?Phonegap是一个利用HTML5去开发App的框架.可以为安卓.iOS.WP.黑莓.火狐等移动操作系统. ...

随机推荐

  1. itextpdf 备忘

    加删除线: .setUnderline(Color.BLACK, 2.0f, 0.0f, 6.0f, 0.0f, 1) https://developers.itextpdf.com/examples ...

  2. 在Ubuntu上安装pyenv 相关问题Common build problems

    Requirements: Ubuntu/Debian: sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libb ...

  3. Flash: Event.PASTE Flash获取剪贴板内容 触发paste事件 how to get paste event

    actionscript把文字存放到剪贴板这个就非常简单了,一般网站做点击复制基本都是这么做的. 但是,基本没有人做flash粘贴内容.今天本来想尝试一下,通过flash实现网页编辑器粘贴图片,但貌似 ...

  4. java获取文件流

      CreateTime--2017年9月1日14:49:21 Author:Marydon servlet获取文件流的两种方式 方式一:使用绝对路径(推荐使用) import java.io.Inp ...

  5. V-rep学习笔记:力传感器

    VREP中可以添加力传感器,用于刚性连接在两个物体之间以测量这两个物体之间的作用力或力矩.如下图所示,力传感器可以测量沿着X.Y.Z三个坐标轴的力和力矩: [Forces and torques me ...

  6. DLib压缩解压程序示例

    /* 这是一个示例程序,使用了Dlib库的compress_stream和cmd_line_parser组件. 这个示例实现了一个简单实用的命令行压缩程序. 当使用-h选项时候,程序输出如下: 使用: ...

  7. centos6.5关闭ipv6

    万境归空,道法自然 1.在/etc/modprobe.d/目录下增加一个新的配置文件ipv6.conf cat << EOF > /etc/modprobe.d/ipv6.confa ...

  8. asiHttpRequst 学习地址

    最全面的地址 http://blog.csdn.net/uxyheaven/article/details/7884734 http://allseeing-i.com/ASIHTTPRequest/ ...

  9. property相关参数介绍

    1.copy 使用类型 :NSString,block 2.assign使用类型 :delegate,int,float,NSInteger,bool,枚举,结构体... 3.retain使用类型 : ...

  10. k8s实战之数据卷(volume)

    一.概述 数据卷用于实现容器持久化数据,k8s对于数据卷重新定义,提供了丰富强大的功能:数据卷分为三类: 本地数据卷,网络数据卷和信息数据卷 二.