Вы находитесь на странице: 1из 5

Install Ruby on Rails in RVM

RVM (Ruby Virtual Machine) is software for work in multiple ruby version, then for every
ruby version allow for install multiple version of Ruby on Rails (RoR).
1. Install RVM in Ubuntu
for install RVM in ubuntu we nee !"UR#! (is a computer software pro$ect proviin% a
library an comman&line tool for transferrin% ata usin% various protocols), if not installe
install with '
sudo apt-get install curl libc6 libcurl3 zlib1g
Install rvm, on terminal run '
\curl -sSL https://get.rvm.io | bash -s stable
(fter success install rvm now we nee reloa shell with '
source ~/.rvm/scripts/rvm
(n whenever open console it must run as lo%in shell, for confi%ure that on menu bar
terminal %o Edit Profile Preferences on tab 'Title and Command choose 'Run
command as a login shell' make sure it checke, after check that click close button then
re&open the terminal winows.
)ow check if rvm has reco%ni*e as ubuntu comman, on terminal run '
type rvm | head -n 1
+hat will result ' rvm is a function
,. -ork&flow RVM
Description :
,.1. "ase
RVM let us work in multiple ruby version, for e.ample if you currently work on two pro$ect
RoR, /0ro$ect 11 is RoR version 2.1 that nee Ruby 1.3.2 an the /0ro$ect 21 is RoR
version 4 that nee Ruby ,.5.1.
,.,. 0repare 0ro$ect
6or prepare that pro$ect you nee a Ruby 1.3.2 an ,.5.1 to RVM, but before we
installe make sure that Ruby version is available for RVM, now run '
rvm list known
+hat will result '
7 MRI Rubies
8ruby&91.:.;8&p4,59
8ruby&91.:.<8&hea9 7 security release on hea
8ruby&91.3.18&p4219
8ruby&91.3.,8&hea9 7 security release on hea
8ruby&91.3.28&p=4<9
8ruby&9,.5.5&p4=1
8ruby&9,.5.58&p4:19
8ruby&9,.1.1
8ruby&9,.18.,9
8ruby&9,.1&hea
ruby&hea
Ruby version 1.3.2 is present for RVM but the version for ,.5.1 is oesn!t e.ist the near
version is ,.5.5, now install Ruby version 1.3.2, on terminal run '
rvm install 1.9.3
(fter success now install Ruby version ,.5.5, on terminal run '
rvm install 2.0.0
(fter both Ruby installe now you can check with '
rvm list
+hat will %ive messa%es '
rvm rubies
ruby&1.3.2&p=4< 8 .:;>;4 9
?@ ruby&,.5.5 8 .:;>;4 9
7 ?A & current
7 ?@ & current BB efault
7 @ & efault
now time for install RoR version 2.1 in Ruby version 1.3.2, in RVM RoR is installe with
%emset (collections of %ems separate by a namespace an associate Ruby installation),
so you can create multiple %emset insie one ruby version. Cefore create %emset for
!0ro$ect 1!, make sure you usin% Ruby 1.3.2, on terminal run '
rvm use ruby-1.9.3-p547
)ow we nee a %emset !0ro$ect 1!, on terminal run '
rvm gemset create Project_1
(fter success create %emset we nee usin% that %emset, with '
rvm gemset use Project_1
Until this step you still not install RoR version 2.1, if you check with '
gem list
+hat will result '
@@@ #D"(# EFMG @@@
bi%ecimal (1.1.5)
bunler (1.;.,)
bunler&unloa (1.5.,)
e.ecutable&hooks (1.2.,)
%em&wrappers (1.,.=)
io&console (5.2)
$son (1.=.=)
minitest (,.=.1)
rake (5.3.,.,)
roc (2.3.=)
ruby%ems&bunler (1.4.4)
rvm (1.11.2.3)
before install check the version rails that present ' https://rubygems.org/gems/rails/versions
for install %em rails with version 2., '
gem install rails -v 3.2.19
(fter finish you can check with !gem list' then you will see !rails (3.2.19' in your local
%emset, that means you has success prepare rvm for !0ro$ect 1!. )ow we nee setup rvm
for !0ro$ect 2!, on terminal run '
rvm use ruby-2.0.0
)ow we nee a %emset !0ro$ect 2!, on terminal run '
rvm gemset create Project_3
(fter success create %emset we nee usin% that %emset, with '
rvm gemset use Project_3
for install %em rails with version 4 '
gem install rails -v 4.0.1
(fter finish you can check with !gem list' then you will see !rails (!.".1' in your local
%emset, that means you has success prepare rvm for !0ro$ect 2!.
,.2. -ork in Hifferent 0ro$ect
In the mornin% you want work on /0ro$ect 11, what you must %onna o is move to pro$ect
irectory then check the Ruby that currently is use '
rvm list
+hat will %ive messa%es '
rvm rubies
ruby&1.3.2&p=4< 8 .:;>;4 9
?@ ruby&,.5.5 8 .:;>;4 9
7 ?A & current
7 ?@ & current BB efault
7 @ & efault
Ruby version is bein% use is ,.1., it marke with ?@, but it not the ri%ht ruby version then
you must move to the ri%ht version, with rvm comman '
rvm use ruby-1.9.3-p547
+hat will %ive notification '
Usin% IhomeImkbI.rvmI%emsIruby&1.3.2&p=4<
now if you check with '
rvm list
+he ruby version is '
?@ ruby&1.3.2&p=4< 8 .:;>;4 9
ruby&,.5.5 8 .:;>;4 9
that means you has been use ruby 1.3.2.
& after we make sure version for Ruby correct, now check what RoR version is currently is
usin%, with sinta. '
rvm gemset list
+hat will result '
%emsets for ruby&1.3.2&p=4< (foun in IhomeImkbI.rvmI%emsIruby&1.3.2&p=4<)
?A (efault)
0ro$ect>1
the si%n !?A! it means you current is use efault %emset, for move to RoR 2.1, use '
rvm gemset use Project_1
+hat will result '
Usin% ruby&1.3.2&p=4< with %emset pro$ect1>ror2.1
)ow if you check '
rvm gemset list
+hat will result '
%emsets for ruby&1.3.2&p=4< (foun in IhomeImkbI.rvmI%emsIruby&1.3.2&p=4<)
(efault)
?A 0ro$ect>1
that means you has move to the RoR 2.1 with ruby version 1.3.2.
& In the ni%ht you want work to pro$ect 2, now you must move to pro$ect irectory then
move to Ruby 4 an chan%e version RoR 4, o the same step like in /0ro$ect 11.

Вам также может понравиться