RVM

51 views
Skip to first unread message

Gethernm

unread,
Oct 24, 2011, 2:17:39 PM10/24/11
to Ruby on Rails: Talk
I wanted to know if i should use RVM? I have been using rails more and
more and more now and am looking to keep ruby and ruby gems better
together. Is it worth using RVM? And what does it acually do other
then able me to swtich between ruby 1.8 and 1.9?

Peter Vandenabeele

unread,
Oct 25, 2011, 3:49:46 AM10/25/11
to rubyonra...@googlegroups.com
On Mon, Oct 24, 2011 at 8:17 PM, Gethernm <geth...@gmail.com> wrote:
I wanted to know if i should use RVM?

Yes.
 
I have been using rails more and
more and more now and am looking to keep ruby and ruby gems better
together. Is it worth using RVM? And what does it acually do other
then able me to swtich between ruby 1.8 and 1.9?

2 important  things it does for me are:

1) I make a gemset for every new project or testing with a new Rails version etc.

So every time, I have a new, clean gem environment (example below)

2) it allows me to install multiple ruby versions, in my _local_ home directory, without
worrying about the version that could be (or maybe not, I don't care) installed by root
in the central /usr/.. directories.

HTH,

Peter

##################

Example of using rvm gemset : with a new gemset it is really easy to bootstrap a new Rails
project, without interfering with the existing ones.

<code>
peterv@ASUS:~/data/temp$ rvm use 1.9.3
Using /home/peterv/.rvm/gems/ruby-1.9.3-rc1

peterv@ASUS:~/data/temp$ rvm gemset list

gemsets for ruby-1.9.3-rc1 (found in /home/peterv/.rvm/gems/ruby-1.9.3-rc1)
   contact_app
   global

peterv@ASUS:~/data/temp$ rvm gemset create fancy
'fancy' gemset created (/home/peterv/.rvm/gems/ruby-1.9.3-rc1@fancy).

peterv@ASUS:~/data/temp$ rvm use 1.9.3@fancy
Using /home/peterv/.rvm/gems/ruby-1.9.3-rc1 with gemset fancy

peterv@ASUS:~/data/temp$ gem list

*** LOCAL GEMS ***

rake (0.9.2)

peterv@ASUS:~/data/temp$ gem install bundler
Fetching: bundler-1.0.21.gem (100%)
Successfully installed bundler-1.0.21
1 gem installed

peterv@ASUS:~/data/temp$ gem install rails
Fetching: multi_json-1.0.3.gem (100%)
...
Successfully installed rails-3.1.1
29 gems installed

peterv@ASUS:~/data/temp$ rails new fancy --skip-bundle -d postgresql -T
      create  
...
      create  vendor/plugins/.gitkeep

peterv@ASUS:~/data/temp$ cd fancy

peterv@ASUS:~/data/temp/fancy$ echo "gem 'therubyracer'" >> Gemfile

peterv@ASUS:~/data/temp/fancy$ bundle install
Fetching source index for http://rubygems.org/
Installing rake (0.9.2.2) 
Using multi_json (1.0.3) 
...
Installing uglifier (1.0.4) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

peterv@ASUS:~/data/temp/fancy$ vim config/database.yml 

peterv@ASUS:~/data/temp/fancy$ rake db:create # will create fancy_development and fancy_test databases

peterv@ASUS:~/data/temp/fancy$ rake environment # this should return without errors
</code>

Peter De Berdt

unread,
Oct 25, 2011, 6:40:36 AM10/25/11
to rubyonra...@googlegroups.com
You can even streamline this a bit more by putting a .rvmrc file in your project folder:

/myproject/.rvmrc

rvm_gemset_create_on_use_flag=1
rvm use <rubyversion>@<gemsetname>

RVM will automatically switch to the proper gemset and ruby version as you "cd" into the project folder (or out of it). There's a lot more options available in the documentation.



Best regards


Peter De Berdt


Jesse Cravens

unread,
Oct 25, 2011, 9:40:24 AM10/25/11
to rubyonra...@googlegroups.com
This may help: http://jessecravens.com/09262011/rvm-ruby-version-manager-and-ruby-rails


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
Jesse Cravens
jessecravens.com
m. 210.392.1542

Brandon Black

unread,
Oct 28, 2011, 7:46:18 PM10/28/11
to Ruby on Rails: Talk
Yes. +1 on everything peter said.
RVM will make your life a lot easier and it helps you manage multiple
projects much better.

Also... you don't have to sudo all the time when you're using RVM.

BeeRich

unread,
Oct 28, 2011, 7:49:05 PM10/28/11
to rubyonra...@googlegroups.com
RVM +1. C'est le fun.

Easy site, pretty straight forward.

Everaldo Gomes

unread,
Oct 28, 2011, 7:53:28 PM10/28/11
to rubyonra...@googlegroups.com
Hi!

I like RVM, but after watching this Railscasts I saw that we have another good alternatives:

Jazmin

unread,
Oct 28, 2011, 8:16:38 PM10/28/11
to rubyonra...@googlegroups.com
YES YOU SHOULD, it will save you a lot of headaches and it is  the preferred way to install ruby nowadays

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
Jazmin

Peter De Berdt

unread,
Oct 29, 2011, 9:32:40 AM10/29/11
to rubyonra...@googlegroups.com

On 29 Oct 2011, at 01:53, Everaldo Gomes wrote:

I like RVM, but after watching this Railscasts I saw that we have another good alternatives:


Vagrant is really nice, but I see it more as a solution to test your production environment locally than to manage gems or ruby versions.

Those VM images can be quite big, but are great to use as a staging server to make sure your production server will be able to run your Rails app (or an update) without any problems. Setting up your production environment on a virtual machine (a staging server if you want to call it that way) is great, especially combined with Chef. You can be fairly certain that your production server won't go down because of some incompatibility or different/lacking dependencies between your e.g. OS X machine and your Ubuntu production server.

radhames brito

unread,
Oct 30, 2011, 9:42:12 AM10/30/11
to rubyonra...@googlegroups.com
On Sat, Oct 29, 2011 at 9:32 AM, Peter De Berdt <peter.d...@pandora.be> wrote:

On 29 Oct 2011, at 01:53, Everaldo Gomes wrote:

I like RVM, but after watching this Railscasts I saw that we have another good alternatives:


Vagrant is really nice, but I see it more as a solution to test your production environment locally than to manage gems or ruby versions.


He is not talking about Vagrant , he is talking about rbenv which is mentioned in the episode 
Reply all
Reply to author
Forward
0 new messages