maintenance/installation of ruby gems/ruby on rails on Linux in general and Gentoo

I am currently looking into Ruby/Ruby on Rails as an alternative to Python/Django. My main problem is that it is rather unclear what the best practices are when it comes to installing Ruby gems and/or Ruby on Rails projects on a Linux with a general dist or Gentoo in particular.

In Gentoo the devs tend to package the gems. It is the prefered way to install those via portage instead of gem. Yet I don't know if this is the right way because you will always have major projects and their dependencies missing which you would either have to write your own ebuild for (not such a big deal) and maintain it. And at that point I don't see any more advantage because I have to follow the packages closely for new developments once I wrote my own ebuild because there won't be any magical bumps to the package. :-) Also the Ruby world is a fast moving target and not all packaged gems in the dist's tree are really up to speed.

On the other hand, installing directly via Bundler or directly via the gem package manager seems kinda flaky as well. You by-pass the dists package manager and have two competing managers if you are not careful. The dist updates to Ruby 1.9.4 and introduces some dist specific characteristics and some gems break unexpectedly, for example. Yet they patch their own packaged gems for it. Or if you use Bundler, projects tend to be rather strict when it comes to the versions of their dependencies and thus, even if a security update for a dependency is available, you might not get it because the project specified explicitly one version. So you have to jump in again manually.

Right now, I would appreciate the community's opinion about the right way (TM) to deal with such things and how to properly maintain a Ruby / Ruby on Rails base and several projects (incl. third party ones) on a production server.

Please note, this is not about how to deploy a project/app. This is about best practices when it comes to maintenance...


Solution 1:

As far as Best Practices, I'd suggest hiring a SysAdmin to perform these functions and monitor your equipment. You needn't hire such a person full-time as there are many system administrators who offer these services on a contract basis for a certain number of hours per month.

Failing that, I assume that this is something of a DevOps organization or a one-person business? In that case, I'd question the choice of Gentoo for a distribution in a setting such as this. Build your application on a stable distribution with pre-compiled packages and vendor support. Focus your functionality on one version of a platform and updating it with newer version periodically as necessary. Do not spend your time chasing after the bleeding edge version of a language or platform that is "fast-moving", as this is a recipe for inefficiency at best and an unsuccessful business venture at worst.

Solution 2:

If you are looking at Rails as alternative to Python / Django it is likely that you already know virtualenv and why you want to use it.

For Ruby and Rails I suggest you take a look at rvm and rbenv.