On Mon, Oct 24, 2011 at 8:17 PM, Gethernm <[email protected]> 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>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to