otto.poellath
otto.poellath

Reputation: 4239

Why should I use application-specific RVM gemsets in addition to Bundler?

I'm using RVM to manage my local Ruby installations, and Bundler for application dependency management.

Some people recommend using a separate RVM gemset for each application, while some seem to think that's not necessary.

So what are the advantages of using a separate RVM gemset for each application, when I'm using Bundler anyway? What are the risks of not doing so?

Upvotes: 5

Views: 900

Answers (4)

ddd
ddd

Reputation: 1985

Might I also refer you to the 'globalcache' documentation in the form of an rvm-test located at fast/globalcache_comment_test.sh in conjunction with your projects' Gemfile.

This will also cut down on the network traffic to rubygems.org. Initial loadout of global, not withstanding.

Upvotes: 1

Peter Klipfel
Peter Klipfel

Reputation: 5178

I've found that it's useful to have rvm if you're using rails 2. RVM is great if you need to work on an app that has old code. Rails 2 doesn't use a Gemfile, so bundle exec doesn't work. RVM makes it easy to keep the gem versions correct for that project, and they you can switch back to newer versions of rails and use the Gemfile to specify versions. If you have multiple apps that use different gem versions, but the same version of ruby, it's convenient to share most of the gems, and specify them in the Gemfile where they differ.

I think it's kind of case dependent. If you find that there are tons of version issues between two apps, and constantly modifying Gemfiles to keep them straight is annoying, then use separate gemsets. If there is enough in common, it might make sense to just use the same gemset

Upvotes: 2

phoet
phoet

Reputation: 18835

i use gemsets in addition to bundler because of the following:

  • easy to just drop everything once a while (i like messing around with my installed gems)
  • no need to call bundle exec (this is obsolete with binstubs)
  • faster loading, because less gem-specs need to be parsed
  • easy to distribute (copy it to your mates)

there are probably more reasons to use them, but i generally like the idea of sandboxes!

Upvotes: 2

mpapis
mpapis

Reputation: 53158

RVM gemsets allow you to separate gems without loading bundler - which is faster, it will be simpler to load the gems.

You should be using gemsets to just separate projects from your helper gems (like gist).

But if you decide that gemsets are of no help for you you can tell RVM to ignore gemsets totally:

echo "export rvm_ignore_gemsets_flag=1" >> ~/.rvmrc

Upvotes: 1

Related Questions