【2017年整理】rvm的安装

上传人:豆浆 文档编号:993091 上传时间:2017-05-24 格式:DOCX 页数:13 大小:35.74KB
返回 下载 相关 举报
【2017年整理】rvm的安装_第1页
第1页 / 共13页
【2017年整理】rvm的安装_第2页
第2页 / 共13页
【2017年整理】rvm的安装_第3页
第3页 / 共13页
【2017年整理】rvm的安装_第4页
第4页 / 共13页
【2017年整理】rvm的安装_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《【2017年整理】rvm的安装》由会员分享,可在线阅读,更多相关《【2017年整理】rvm的安装(13页珍藏版)》请在金锄头文库上搜索。

1、 rvm 的安装, 使用 rvm, 安装 ruby, 以及 gem 的使用分类: Ruby on Rails2012-07-21 14:50 2813 人阅读 评论(0) 收藏 举报rubyredisrubygemsyamlcacheuploadhttp:/ 全称 Ruby Version Manager, 确实是一个非常好用的 ruby 版本管理以及安装工具.下面介绍一下 rvm 的安装, 使用 rvm, 安装 ruby, 以及 gem 的使用.一、安装 rvm官方网站上介绍得很简单, 但是使用官方网站安装会出现问题, SSL 的问题. 所以我分两步进行, 第一步下载安装脚本. 第二步修改安

2、装脚本. 第三步安装.以下介绍的是使用 root 用户在 CentOS 中安装 rvm 的过程.1. 下载脚本到 ins 文件中. 注意使用了 curl 的-k 选项, 因为地址是 https 的. 不加-k 会报异常.rootdb-172-16-3-33 # curl -k https:/ ./ins2. 修改 ins 脚本中的 curl 都加上 -k 否则会无法使用.vi ins需要修改两处 curl.curl -sk https:/ curl -kL $_url -o $rvm_archives_path/$_file3. 使用修改后的 ins 脚本安装 rvmrootdb-172-16

3、-3-33 # cat ins|bash -s stable输出结果 : Downloading RVM from wayneeseguin branch stable% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed100 1023k 100 1023k 0 0 173k 0 0:00:05 0:00:05 -:-:- 383kInstalling RVM to /usr/local/rvm/Creating RVM system user gro

4、up rvm# RVM: Shell scripts enabling management of multiple ruby environments.# RTFM: https:/rvm.io/# HELP: http:/ (#rvm on )# Cheatsheet: http:/ Screencast: http:/screencasts.org/episodes/how-to-use-rvm# In case of any issues read output of rvm requirements and/or rvm notesInstallation of RVM in /us

5、r/local/rvm/ is almost complete:* First you need to add all users that will be using rvm to rvm group,and logout - login again, anyone using rvm will be operating with umask g+w.* To start using RVM you need to run source /etc/profile.d/rvm.shin all your open shell windows, in rare cases you need to

6、 reopen all shell windows.# root,# Thank you for using RVM!# I sincerely hope that RVM helps to make your life easier and more enjoyable!# Wayne4. 修改 root 下的环境变量vi /.bash_profileexport PATH=/usr/local/rvm/bin:/opt/git1.7.10.2/bin:$PATH更新环境变量. /.bash_profile这里就安装完 rvm 了二、rvm 的使用, 简单的介绍一下rootdb5 # rvm

7、 list helpUsage:rvm list action Actions:help,known,gemsets,default string,rubies,strings,known_strings,ruby_svn_tags1. 列出 rvm 管理的软件及版本rootdb5 # rvm list known# MRI Rubiesruby-1.8.6-p420ruby-1.8.7-p358ruby-1.8.7-headruby-1.9.1-p431ruby-1.9.2-p180ruby-1.9.2-p290ruby-1.9.2-p318ruby-1.9.2-p320ruby-1.9.2

8、-headruby-1.9.3-preview1ruby-1.9.3-rc1ruby-1.9.3-p0ruby-1.9.3-p125ruby-1.9.3-p194ruby-1.9.3-headruby-head# GoRubygoruby# TheCodeShop - MRI experimental patchestcs# JRubyjruby-1.2.0jruby-1.3.1jruby-1.4.0jruby-1.6.5jruby-1.6.5.1jruby-1.6.6jruby-1.6.7jruby-1.6.7.2jruby-headjruby-1.7.0.preview1# Rubiniu

9、srbx-1.0.1rbx-1.1.1rbx-1.2.3rbx-1.2.4rbx-headrbx-2.0.testing# Ruby Enterprise Editionree-1.8.6ree-1.8.7-2012.02# Kijikiji# MagLevmaglev-headmaglev-1.0.0# Mac OS X Snow Leopard Or Newermacruby-0.10macruby-nightlymacruby-head# IronRuby - Not implemented yet.ironruby-0.9.3ironruby-1.0-rc2ironruby-head三

10、、使用 RVM 安装 ruby从上面的输出我们能看到 rvm 管理的 ruby 版本中包含了当前的稳定版 1.9.3-p194, 接下来就安装这个版本.但是注意, 使用 rvm 安装的话需要联网, 怎么办呢? 可以不联网吗? 可能不可以, 因为要获得依赖关系什么的, 但是可以提前下载好安装包房到 archives 目录下, 这样可以省去下载包的过程.1. 联网安装rootdb5 # rvm install ruby-1.9.3-p194输出Fetching yaml-0.1.4.tar.gz to /usr/local/rvm/archives% Total % Received % Xfer

11、d Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 460k 100 460k 0 0 91728 0 0:00:05 0:00:05 -:-:- 190kExtracting yaml-0.1.4.tar.gz to /usr/local/rvm/srcPrepare yaml in /usr/local/rvm/src/yaml-0.1.4.Configuring yaml in /usr/local/rvm/src/yaml-0.1.4.Compiling yaml in /usr/l

12、ocal/rvm/src/yaml-0.1.4.Installing yaml to /usr/local/rvm/usrInstalling Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s).ruby-1.9.3-p194 - #fetching ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your conne

13、ction.% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed. 略到安装 rubygems 的时候会出错, 无法获取版本号. 所以需要手工安装 rubygems.- 下载 rubygems 错误,貌似版本信息没有获取到.Retrieving rubygems-% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Spe

14、ed0 0 0 0 0 0 0 0 -:-:- -:-:- -:-:- 0curl: (22) The requested URL returned error: 404The requested url does not exist: http:/production.cf.rubygems.org/rubygems/rubygems-.tgzTrying ftp:/ URL instead.CTRL+C 退出- 手动安装 rubygems, 见第 3 步2. 下载好包后放到 archives 目录下再安装如果下载太慢, 也可以先下载好 yaml-0.1.4.tar.gz, ruby-1.9.3-p194.tar.bz2 放在/usr/local/rvm/archives 下面然后执行rvm install ruby-1.9.3-p1943. 安装 rubygems下载 rubygems 安装包.wget http:/production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz解压tar

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号