Mac 下安装Ruby环境(转)
步骤1 - 安装 RVM
RVM 是干什么的这里就不解释了,后面你将会慢慢搞明白。
$ curl -L https://get.rvm.io | bash -s stable
期间可能会问你sudo管理员密码,这里可能需要等待一段时间后就可以成功安装好 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 设置为系统默认版本
测试是否正确
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
正常的输出结果:
这里就表示已经把Ruby环境成功的安装到了Mac 上了。
转至:Mac 下安装Ruby环境
Mac 下安装Ruby环境(转)的更多相关文章
- Mac 下安装Ruby环境
步骤1 - 安装 RVM RVM 是干什么的这里就不解释了,后面你将会慢慢搞明确. $ curl -L https://get.rvm.io | bash -s stable 期间可能会问你sudo管 ...
- Mac 下安装 ruby 环境解决 brew 安装 yarn 问题
在brew安装yarn提示 ruby的版本过低.在网上搜了一下发现 1. mac下自带的ruby 在 system 目录下 2. 其实可以用brew安装一个ruby brew install ruby ...
- linux系统下安装ruby环境
1. 移除现有 Ruby 默认源 输入以下指令 $gem sources --remove https://rubygems.org/ 2. 使用新的源 输入以下指令 $gem sources -a ...
- mac下升级ruby环境版本
在ios开发中会经常使用到cocoapods来管理第三方框架,在安装cocoapods的时候会涉及到ruby环境,有时候会因为版本过低会导致安装失败,本文主要讲一下如何升级ruby环境 安装rvm,r ...
- mac下安装libpng环境
用go写一个爬虫工具时需要使用一个go的库,而这个库有需要使用libpng库,不然编译就会提示说 png.h找不到等之类的信息,于是想到应该和windows一样需要安装gcc环境,然后让gcc里安装l ...
- linux下安装ruby环境
安装步骤: ruby的shell叫irb,我们可以输入irb -v查看下irb的版本号 1.安装ruby解释器shell: yum install ruby-irb -y Installed: rub ...
- Mac 下安装ruby,以及CocoaPods安装以及使用网摘
ruby安装网址:https://ruby-china.org/wiki/install_ruby_guide CocoaPods安装和使用教程地址:http://code4app.com/artic ...
- Mac下安装cocos2d-x环境
安装后xcode之后,下载cocos2dx压缩包,解压 通过中断cd到cocos2dx文件夹内 输入下行命令 sudo ./install-templates-xcode.sh 执行成功后打开xcod ...
- 转-MAC 下安装PHONEGAP开发环境
来自:http://jinzhe.net/post/8.html 什么是Phonegap呢?Phonegap是一个利用HTML5去开发App的框架.可以为安卓.iOS.WP.黑莓.火狐等移动操作系统. ...
随机推荐
- [Codeforces #192] Tutorial
Link: Codeforces #192 传送门 前两天由于食物中毒现在还要每天挂一天的水 只好晚上回来随便找套题做做找找感觉了o(╯□╰)o A: 看到直接大力模拟了 但有一个更简便的方法,复杂度 ...
- sum nowcode
时间限制:1秒 空间限制:131072K 题目描述 考虑维护一个这样的问题:(1) 给出一个数组A,标号为1~n(2) 修改数组中的一个位置.(3) 询问区间[l,r]中所有子集的位运算and之和mo ...
- BZOJ 3437 小P的牧场(斜率优化DP)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=3437 [题目大意] n个牧场排成一行,需要在某些牧场上面建立控制站, 每个牧场上只能建 ...
- getDimension,getDimensionPixelOffset和getDimensionPixelSize
dimens.xml里写上三个变量: <dimen name="activity_vertical_margin1">16dp</dimen> <di ...
- [POJ3728]The merchant
题目大意: 给你一棵n个结点的带权树,有q组询问,问你从u到v的路径上最大值与最小值的差(最大值在最小值后面). 思路: 首先考虑路径上合并两个子路径u->t和t->v时的情况. 假设我们 ...
- storm性能优化
Storm 性能优化 目录 场景假设 调优步骤和方法 Storm 的部分特性 Storm 并行度 Storm 消息机制 Storm UI 解析 性能优化 场景假设 在介绍 Storm 的性能调优方法之 ...
- 【个人专用&入门级】LAMP一键安装包
最近自学了下Shell编程,也算是入门吧!按照如下教程,编译安装了LAMP(Apache-2.4.6 + MySQL-5.5.25 + PHP-5.3.27) CentOS6.3编译安装LAMP(1) ...
- Inno Setup自定义卸载文件名称的脚本
Inno Setup 支持在同一个目录中安装多个应用程序,所以根据安装的先后次序自动将卸载程序文件命名为 unins000.exe,unins001.exe,unins002.exe 等等.这是 IN ...
- 用yum安装完mysql后没有mysqld的问题
在Centos中用命令 yum install mysql安装数据库,但装完后运行mysqld启动mysql的时候提示找不到,通过 find / | grep mysqld 也没找到mysqld的目录 ...
- 网络上的等待事件 —— SQL*Net message from client/dblink
SQL*Net message from client SQL> select event#,name,parameter1,parameter2,parameter3 from v$event ...