Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from stackoverflow.com Aug 19 '10 at 22:53

This question came from our site for professional and enthusiast programmers.

    
Wrong forum to post this on, this is more of a superuser.com question... when it closes, it will be migrated across.... – t0mm13b Aug 19 '10 at 22:48
    
@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 Aug 19 '10 at 23:41
    
@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 Aug 25 '10 at 22:17
up vote 4 down vote accepted

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

Ruby on Rails: gem install versus apt-get

share|improve this answer
    
Using only apt-get would also reduce confusion. What about other reasons? – JonnyJD Dec 22 '12 at 19:55

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.

share|improve this answer
    
Please comment if some main reasons or consequences are missing. I still don't feel like I know the perfect solution myself. – JonnyJD Dec 22 '12 at 20:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .