设为首页 收藏本站
查看: 473|回复: 0

[经验分享] Install Ruby Version Manager (RVM) On CentOS 5.5(转)

[复制链接]

尚未签到

发表于 2016-5-12 07:13:54 | 显示全部楼层 |阅读模式
  
RVM, or Ruby Version Manager is a popular and effective way to manage running multiple Ruby environments. Here is how you set it up on CentOS 5.5:
1) Add the Webtatic respository and install Git.
1
2
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
yum install --enablerepo=webtatic git




(Note that this command will also install the perl-Error and perl-Git dependencies)
2) Create an rvm user and group.
1
2
groupadd rvm
useradd -g rvm rvm



3) Add the root user to the rvm group (required for installation)
1
usermod -a -G rvm root



4) Install RVM as root.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
bash < <(curl -L http://bit.ly/rvm-install-system-wide)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5840  100  5840    0     0   1620      0  0:00:03  0:00:03 --:--:--  5653
Group 'rvm' exists, proceeding with installation.
Adding 'root' to the group 'rvm'
Creating the destination dir and making sure the permissions are correct
Cloning into rvm...
remote: Counting objects: 4206, done.
remote: Compressing objects: 100% (2029/2029), done.
Receiving objects:  26% (1094/4206), 796.00 KiB | 54 KiB/s
....
Setting up group permissions
Generating system wide rvmrc
Generating /usr/local/lib/rvm to load rvm
Correct permissions on rvmrc and the rvm loader
RVM is now installed. To use, source '/usr/local/lib/rvm' to your shell profile.



5) Install zlib via RVM.
1
2
3
4
5
6
7
8
9
# rvm package install zlib
Fetching zlib-1.2.5.tar.gz to /usr/local/rvm/archives
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  531k  100  531k    0     0   206k      0  0:00:02  0:00:02 --:--:--  226k
Extracting zlib-1.2.5.tar.gz to /usr/local/rvm/src
Configuring zlib in /usr/local/rvm/src/zlib-1.2.5.
Compiling zlib in /usr/local/rvm/src/zlib-1.2.5.
Installing zlib to /usr/local/rvm/usr



6) Install Ruby 1.9.2 using RVM.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# rvm install 1.9.2 -C --with-zlib-dir=/usr/local/rvm/src/
Installing Ruby from source to: /usr/local/rvm/rubi
                while depending on your cpu(s)...
ruby-1.9.2-p180 - #fetching
ruby-1.9.2-p180 - #extracting ruby-1.9.2-p180 to /u
ruby-1.9.2-p180 - #extracted to /usr/local/rvm/src/
ruby-1.9.2-p180 - #configuring
ruby-1.9.2-p180 - #compiling
ruby-1.9.2-p180 - #installing
ruby-1.9.2-p180 - Updating #rubygems to the latest.
Removing old Rubygems files...
Installing rubygems dedicated to ruby-1.9.2-p180...
Installing rubygems for /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
Installation of rubygems completed successfully.
ruby-1.9.2-p180 - Updating #rubygems to the latest.
Removing old Rubygems files...
Installing rubygems dedicated to ruby-1.9.2-p180...
Installing rubygems for /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
Installation of rubygems completed successfully.
ruby-1.9.2-p180 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.2-p180 - #importing default gemsets (/usr/local/rvm/gemsets/)
Install of ruby-1.9.2-p180 - #complete



7) Set the RVM default to version 1.9.2
1
2
# rvm --default use 1.9.2
Using /usr/local/rvm/gems/ruby-1.9.2-p180



 Verify that Ruby version 1.9.2 was installed successfully.
1
2
# ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]



9) Add this environment variable to root’s .bash_profile file.
1
[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm"



10) Install rails.
  
1
2
3
4
5
6
7
8
# gem install rails
Fetching: activesupport-3.0.5.gem (100%)
Fetching: builder-2.1.2.gem (100%)
Fetching: i18n-0.5.0.gem (100%)
...
Installing RDoc documentation for railties-3.0.5...
Installing RDoc documentation for bundler-1.0.10...
Installing RDoc documentation for rails-3.0.5...


  
  

  转自:http://blog.danotes.com/2011/03/16/install-ruby-version-manager-rvm-on-centos-5-5.html

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-215750-1-1.html 上篇帖子: 在CentOS 6.0安装LAMP服务器 下篇帖子: centos下远程桌面的设置及问题处理
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表