升级ruby的版本
升级ruby版本,有时候安装ruby的版本过低,需要进行升级,例如安装在centos6.7安装fpm需要ruby版本在1.9以上。
1、主机环境如下:
[root@test ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)
[root@test ~]# uname -r
2.6.-.el6.x86_64
2、使用yum安装ruby
[root@web ~]# yum install rubygems ruby-devel
Loaded plugins: fastestmirror, security
Setting up Install Process
base | 3.7 kB :
base/primary_db | 4.7 MB :
extras | 3.4 kB :
extras/primary_db | kB :
updates | 3.4 kB :
updates/primary_db | 8.1 MB :
Resolving Dependencies
--> Running transaction check
---> Package ruby-devel.x86_64 :1.8.7.374-.el6 will be installed
--> Processing Dependency: ruby-libs = 1.8.7.374-.el6 for package: ruby-devel-1.8.7.374-.el6.x86_64
--> Processing Dependency: libruby.so.1.8()(64bit) for package: ruby-devel-1.8.7.374-.el6.x86_64
---> Package rubygems.noarch :1.3.-.el6 will be installed
--> Processing Dependency: ruby-rdoc for package: rubygems-1.3.-.el6.noarch
--> Processing Dependency: /usr/bin/ruby for package: rubygems-1.3.-.el6.noarch
--> Running transaction check
---> Package ruby.x86_64 :1.8.7.374-.el6 will be installed
---> Package ruby-libs.x86_64 :1.8.7.374-.el6 will be installed
---> Package ruby-rdoc.x86_64 :1.8.7.374-.el6 will be installed
--> Processing Dependency: ruby-irb = 1.8.7.374-.el6 for package: ruby-rdoc-1.8.7.374-.el6.x86_64
--> Running transaction check
---> Package ruby-irb.x86_64 :1.8.7.374-.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved ==============================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================
Installing:
ruby-devel x86_64 1.8.7.374-.el6 base k
rubygems noarch 1.3.-.el6 base k
Installing for dependencies:
ruby x86_64 1.8.7.374-.el6 base k
ruby-irb x86_64 1.8.7.374-.el6 base k
ruby-libs x86_64 1.8.7.374-.el6 base 1.7 M
ruby-rdoc x86_64 1.8.7.374-.el6 base k Transaction Summary
==============================================================================================================================
Install Package(s) Total download size: 3.4 M
Installed size: M
Is this ok [y/N]: y
Downloading Packages:
(/): ruby-1.8.7.374-.el6.x86_64.rpm | kB :
(/): ruby-devel-1.8.7.374-.el6.x86_64.rpm | kB :
(/): ruby-irb-1.8.7.374-.el6.x86_64.rpm | kB :
(/): ruby-libs-1.8.7.374-.el6.x86_64.rpm | 1.7 MB :
(/): ruby-rdoc-1.8.7.374-.el6.x86_64.rpm | kB :
(/): rubygems-1.3.-.el6.noarch.rpm | kB :
------------------------------------------------------------------------------------------------------------------------------
Total kB/s | 3.4 MB :
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS- Key (CentOS Official Signing Key) <centos--key@centos.org>
Package: centos-release--.el6.centos.12.3.x86_64 (@anaconda-CentOS-.x86_64/6.7)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : ruby-libs-1.8.7.374-.el6.x86_64 /
Installing : ruby-1.8.7.374-.el6.x86_64 /
Installing : ruby-irb-1.8.7.374-.el6.x86_64 /
Installing : ruby-rdoc-1.8.7.374-.el6.x86_64 /
Installing : rubygems-1.3.-.el6.noarch /
Installing : ruby-devel-1.8.7.374-.el6.x86_64 /
Verifying : ruby-rdoc-1.8.7.374-.el6.x86_64 /
Verifying : ruby-1.8.7.374-.el6.x86_64 /
Verifying : rubygems-1.3.-.el6.noarch /
Verifying : ruby-libs-1.8.7.374-.el6.x86_64 /
Verifying : ruby-irb-1.8.7.374-.el6.x86_64 /
Verifying : ruby-devel-1.8.7.374-.el6.x86_64 / Installed:
ruby-devel.x86_64 :1.8.7.374-.el6 rubygems.noarch :1.3.-.el6 Dependency Installed:
ruby.x86_64 :1.8.7.374-.el6 ruby-irb.x86_64 :1.8.7.374-.el6 ruby-libs.x86_64 :1.8.7.374-.el6
ruby-rdoc.x86_64 :1.8.7.374-.el6 Complete!
3、查看ruby的版本
[root@web ~]# ruby -v
ruby 1.8. (-- patchlevel ) [x86_64-linux]
4、升级ruby1.9.3版本
1)删除原来的rubygems仓库
[root@web ~]# gem sources --remove http://rubygems.org/
2)添加aliyun的rubygems仓库
[root@web ~]# gem sources -a http://mirrors.aliyun.com/rubygems/
3)查看rubygems仓库
[root@web ~]# gem sources -l
*** CURRENT SOURCES *** http://mirrors.aliyun.com/rubygems/
4)使用RVM进行升级ruby
a:在rvm官方网址:https://rvm.io/执行如下命令:
[root@web ~]# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net
gpg: requesting key 39499BDB from hkp server keys.gnupg.net
gpg: key D39DC0E3: "Michal Papis (RVM signing) <mpapis@gmail.com>" not changed
gpg: key 39499BDB: public key "Piotr Kuczynski <piotr.kuczynski@gmail.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed:
gpg: imported: (RSA: )
gpg: unchanged:
b:接着执行如下命令:
[root@web ~]# \curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.3.tar.gz
curl: () SSL connect error Could not download 'https://github.com/rvm/rvm/archive/1.29.3.tar.gz'.
curl returned status ''. Downloading https://bitbucket.org/mpapis/rvm/get/1.29.3.tar.gz
Downloading https://bitbucket.org/mpapis/rvm/downloads/1.29.3.tar.gz.asc
curl: () couldn't connect to host Could not download 'https://bitbucket.org/mpapis/rvm/downloads/1.29.3.tar.gz.asc'.
curl returned status ''. Creating group 'rvm' Installing RVM to /usr/local/rvm/
Installation of RVM in /usr/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 u=rwx,g=rwx,o=rx`. * To start using RVM you need to run `source /etc/profile.d/rvm.sh`
in all your open shell windows, in rare cases you need to reopen all shell windows.
c:执行上述命令 * To start using RVM you need to run `source /etc/profile.d/rvm.sh`
[root@web ~]# source /etc/profile.d/rvm.sh
5、查看RVM可安装的ruby的版本
[root@web ~]# rvm list known
# MRI Rubies
[ruby-]1.8.[-p420]
[ruby-]1.8.[-head] # security released on head
[ruby-]1.9.[-p431]
[ruby-]1.9.[-p330]
[ruby-]1.9.[-p551]
[ruby-]2.0.[-p648]
[ruby-]2.1[.]
[ruby-]2.2[.]
[ruby-]2.3[.]
[ruby-]2.4[.]
ruby-head # for forks use: rvm install ruby-head-<name> --url https://github.com/github/ruby.git --branch 2.2 # JRuby
jruby-1.6[.]
jruby-1.7[.]
jruby[-9.1.13.0]
jruby-head # Rubinius
rbx-[.4.3]
rbx-2.3[.]
rbx-2.4[.]
rbx-[.5.8]
rbx-[.]
rbx-head # Opal
opal # Minimalistic ruby implementation - ISO :
mruby-1.0.
mruby-1.1.
mruby-1.2.
mruby-[.3.0]
mruby[-head] # Ruby Enterprise Edition
ree-1.8.
ree[-1.8.][-2012.02] # Topaz
topaz # MagLev
maglev[-head]
maglev-1.0. # Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head # IronRuby
ironruby[-1.1.]
ironruby-head
6、安装ruby-1.9.3版本
[root@web ~]# rvm install 1.9.
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/centos/6/x86_64/ruby-1.9.3-p551.tar.bz2
Checking requirements for centos.
Installing requirements for centos.
Installing required packages: libffi-devel, readline-devel, sqlite-devel, zlib-devel, libyaml-devel, openssl-devel...........|
Requirements installation successful.
ruby-1.9.-p551 - #configure
ruby-1.9.-p551 - #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
10.2M 10.2M 188k :: :: --:--:-- 223k
ruby-1.9.-p551 - #validate archive
ruby-1.9.-p551 - #extract
ruby-1.9.-p551 - #validate binary
ruby-1.9.-p551 - #setup
ruby-1.9.-p551 - #gemset created /usr/local/rvm/gems/ruby-1.9.-p551@global
ruby-1.9.-p551 - #importing gemset /usr/local/rvm/gemsets/global.gems...................................
ruby-1.9.-p551 - #generating global wrappers........
ruby-1.9.-p551 - #gemset created /usr/local/rvm/gems/ruby-1.9.-p551
ruby-1.9.-p551 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-1.9.-p551 - #generating default wrappers........
7、查看ruby是否升级成功
[root@web ~]# ruby -v
ruby 1.9.3p551 (-- revision ) [x86_64-linux]
至此,ruby版本升级成功
升级ruby的版本的更多相关文章
- mac下升级ruby环境版本
在ios开发中会经常使用到cocoapods来管理第三方框架,在安装cocoapods的时候会涉及到ruby环境,有时候会因为版本过低会导致安装失败,本文主要讲一下如何升级ruby环境 安装rvm,r ...
- Ruby学习笔记之升级ruby的版本
升级ruby版本,有时候安装ruby的版本过低,需要进行升级,例如安装在centos6.7安装fpm需要ruby版本在1.9以上. 0x00 主机环境如下 [root@test ~]# cat /et ...
- 升级ruby的版本 https://gems.ruby-china.com/
升级ruby版本,有时候安装ruby的版本过低,需要进行升级,例如安装在centos6.7安装fpm需要ruby版本在1.9以上. 1.主机环境如下: 1 [root@test ~]# cat /et ...
- 升级ruby版本那"不堪回首的经历"
前段时间在玩Chef-一个IT基础设施自动化工具.由于Chef是由Ruby写的一个gem,那么就需要安装Ruby.当然Ruby我早就安装了,并且使用rvm来管理Ruby及Gem.本来一切看似正常,但是 ...
- 关于IOS新手在安装cocoa pods失败,因为ruby版本过低的解决方法+ (void) {升级ruby}
http://blog.csdn.net/zhaoen95/article/details/51995520 现在: 使用 OS 系统, 正在学习iOS 需要配置cocoapods 命令行中显 ...
- 升级ruby后再安装cocodPod
1.移除现有的Ruby $gem sources --remove https://rubygems.org/ 2.使用淘宝镜像 $gem sources -a https://ruby.taobao ...
- 升级ruby
1.安装 RVM RVM:Ruby Version Manager,Ruby版本管理器,包括Ruby的版本管理和Gem库管理(gemset) $ curl -L get.rvm.io | bash - ...
- Linux升级Ruby
一.简介 Ruby 是一种开源的面向对象程序设计的服务器端脚本语言,在 20 世纪 90 年代中期由日本的松本行弘(まつもとゆきひろ/Yukihiro Matsumoto)设计并开发.在 Ruby 社 ...
- cocoaPods升级遇到的问题 升级ruby 升级cocoaPos
最近重复了一次,修复一些更改. 1.查询 rvm版本rvm -v 2.查询ruby版本ruby -v 3.查询 gem 版本gem -v 4.查询ruby 镜像gem sources -l 5.升级r ...
随机推荐
- LightOJ1370 Bi-shoe and Phi-shoe —— 欧拉函数
题目链接:https://vjudge.net/problem/LightOJ-1370 1370 - Bi-shoe and Phi-shoe PDF (English) Statistics ...
- poj3904 Sky Code —— 唯一分解定理 + 容斥原理 + 组合
题目链接:http://poj.org/problem?id=3904 Sky Code Time Limit: 1000MS Memory Limit: 65536K Total Submiss ...
- laravel基础课程---2、Laravel配置文件、路由及php artisan(php artisan是什么)
laravel基础课程---2.Laravel配置文件.路由及php artisan(php artisan是什么) 一.总结 一句话总结: PHP工具匠:php artisan,其实本身就是一些PH ...
- html5--5-13 渐变色
html5--5-13 渐变色 学习要点 掌握渐变色的绘制方法 渐变色绘制方法 createLinearGradient() 创建线性渐变 createLinearGradient(x1,y1,x2, ...
- 脚踏实地学C#5-扩展方法
扩展方法(Extension Method) MSDN定义:能够向现有类型“添加”方法,而无需创建新的派生类型.重新编译或以其他方式修改原始类型. 扩展方法须知: 1.扩展方法声明所在的类必须被声明为 ...
- WPF-初始屏幕(SplashScreen)
本主题介绍如何将启动窗口(也称为“初始屏幕”)添加到 Windows Presentation Foundation (WPF) 应用程序. 添加现有图像作为初始屏幕 创建或查找要用于初始屏幕的图像. ...
- hadoop源码剖析--RawLocalFileSystem
RawLocalFileSystem是hadoop中实现的本地文件系统,在该类中与文件元数据和目录相关的操作,都是通过适配方式适配到java.io.File的对应API来完成的,适配过程简单,代码清晰 ...
- 静态路由配置及RIP配置实验
[实验环境] Packet Trace 5.3 模拟软件. [实验步骤] 1.首先要进行IP地址规划.(例如下图格式) 网络名 网络地址 子网掩码 网关 主机IP vlan1 10.10.1.0 25 ...
- [转载]支付宝钱包手势密码破解实战(root过的手机可直接绕过手势密码)
/* *转自http://blog.csdn.net/hu3167343/article/details/36418063 *本文章由 莫灰灰 编写,转载请注明出处. *作者:莫灰灰 邮箱: m ...
- AJAX获取数据,需要添加事件
如果是通过异步请求从后端获取的数据来渲染页面,要添加事件,必须要在页面已有的元素上,添加时间代理.因为页面渲染需要时间,如果直接绑定在响应时间元素上面,很有可能触发不了事件.