Install packages through apt-get or gem?

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

Ruby on Rails: gem install versus apt-get


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.