Install packages through apt-get or gem?

14

4

If a package is available both through apt-get and gem, which one should I choose?

I'm on Ubuntu and I don't know if I should install rake through apt-get or gem.

I use both apt-get and gem packages a lot.

What are the pros and cons with each?

ajsie

Posted 2010-08-19T22:40:09.657

Reputation: 1 675

Wrong forum to post this on, this is more of a superuser.com question... when it closes, it will be migrated across.... – t0mm13b – 2010-08-19T22:48:38.187

@tommieb75: I can see why this would fit in SU, but I'm kind of surprised that it's not seen as programming-related. – Andrew Grimm – 2010-08-19T23:41:56.120

@Andrew: where does it say anything in the question in relation to programming....???!!! I do not see it... :) This is the right place for it and answers are below....! ;) – t0mm13b – 2010-08-25T22:17:58.103

Answers

4

You should always use RubyGems to install any kind of Gems (eg. Rails) to reduce confusion.

Ruby on Rails: gem install versus apt-get

zengr

Posted 2010-08-19T22:40:09.657

Reputation: 1 334

Using only apt-get would also reduce confusion. What about other reasons? – JonnyJD – 2012-12-22T19:55:25.917

8

You should use

apt-get

  • If you care about uninstalling gems with their dependencies. RubyGems will not uninstall unused dependencies. See do-i-have-to-manually-uninstall-all-dependent-gems. If you care about uninstalling gems as a group, rvm is also an option (see below).
  • If that gem would or should install executables in /usr/bin.
  • If you want to upgrade gems together with the rest of the system (automatically)

gem

  • If you want the most simple approach
  • If you want to have multiple versions of a gem available on the system
  • Need very recent or very old versions of some gems
  • Want to install only for one user

bundler

  • If you want to install certain gems only for one application

rvm + gem

  • If you need different sets of gems installed or removed independently

You should not mix between using apt-get and gem arbitrarily. That means you should not, but when you do; you should know and remember why you did this.

When you use different methods, the overall system gets more complex.

JonnyJD

Posted 2010-08-19T22:40:09.657

Reputation: 3 203

Please comment if some main reasons or consequences are missing. I still don't feel like I know the perfect solution myself. – JonnyJD – 2012-12-22T20:31:38.970