Mac 下安装Ruby环境
步骤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环境的更多相关文章
- 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.黑莓.火狐等移动操作系统. ...
随机推荐
- 〖Linux〗秒开www.stackoverflow.com,非代理方式
stackoverflow.com就不介绍了,一种解决方法就是手动分析链接,使用nslookup得到hosts: #stack overflow 198.252.206.140 cdn.sstatic ...
- MySQL存储引擎--MYSIAM和INNODB引擎区别
参考:http://blog.csdn.net/memray/article/details/8914042 MYSIAM和INNODB引擎区别主要有以下几点: 1.MyISAM查询性能比InnoDB ...
- iOS 瀑布流之栅格布局
代码地址如下:http://www.demodashi.com/demo/14760.html 一 .效果预览 二.确定需求 由下面的需求示意图可知模块的最小单位是正方形,边长是屏幕宽除去边距间隔后的 ...
- 【转】 mysql反引号的使用(防冲突)
转载地址:http://blog.itechol.com/space.php?uid=33&do=blog&id=6681 1.mysql语句中 反引号 [`]作用: 避免表明.字段名 ...
- PHPNow升级PHP版本为5.3.5的方法(转)
PHPNow升级PHP版本为5.3.5的方法 原文:http://sharebar.org/1142.html 在WIN上有时候需要测试一些PHP程序,又不会自行独立配置环境,那么PHPNow是非常好 ...
- memcached全面剖析--3.memcached的删除机制和发展方向
下面是<memcached全面剖析>的第三部分. 发表日:2008/7/16 作者:前坂徹(Toru Maesaka) 原文链接:http://gihyo.jp/dev/feature/0 ...
- linux下网络配置小节[from 老男孩的linux运维笔记]
对于linux高手看似简单的网络配置问题,也许要说出所以然来也并不轻松,因此仍然有太多的初学者徘徊在门外就不奇怪了, 这里,老男孩老师花了一些时间总结了这个文档小结,也还不够完善,欢迎大家补充,交流. ...
- A. Candy Bags
A. Candy Bags http://codeforces.com/problemset/problem/334/A time limit per test 1 second memory l ...
- TensorFlow Google大会总结
一.概述 介绍TPU,需要使用XLA编译,否则没有做内部优化,无法达到加速的效果: TPU相关的性能分析器: 二.新版本的输入库 之前TensorFlow的输入方式: feed_dict: 太过于低效 ...
- 横竖屏切换时不销毁当前activity 和 锁定屏幕
首先在Mainifest.xml的Activity元素中加入android:configChanges="orientation|keyboardHidden"属性 <act ...