Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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...

share|improve this question
add comment

2 Answers

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.

share|improve this answer
    
Thanks for your comment but this question was not about which distribution to use. Gentoo is a very flexible dist and if you know what you are doing, it is really a great tool to have. But again, that was not the point of this topic. Suggesting to hire a sysadmin is like telling a software engineer who is trying to figure out a bug that he should hire a software engineer (btw I am both). ;) Asking questions and asking others for opinions/suggestions is imho a sign of responsibility and professionalism because no one can know it all. And I was never one to pretend to have all the answers... –  khaos Apr 30 '12 at 4:56
    
@Adrian: Gentoo CAN be very stable, too. Forget the funroll-loops stuff, use the USE flags sensibly, have a test/staging environment where you build the binary versions for your production servers, have everything under version control. There are gotchas, of course, and for a noob I would not recommend Gentoo. But for special needs and environments Gentoo can actually be a very nice distro -- the rolling-release distro has its upsides, too. The "compile everything from source" approach can be good; how often you hear people complaining about FreeBSD ports or {Net,Open}BSD pkgsrc? –  Janne Pikkarainen Apr 30 '12 at 12:20
    
@JannePikkarainen All those points are true, but it's still a significant distraction from a small start-up unless someone has a system guy on their team already. Hence my post. –  Magellan Apr 30 '12 at 16:41
    
@khaos I'm not saying that Gentoo isn't flexible. In fact, that's exactly what I'm saying is that it's so flexible that it isn't the best choice for a small organization to base their business around. And really, sometimes OPs need to be told about the underlying issue that they're encountering and where they're going wrong, not just a simple answer to the surface question. –  Magellan Apr 30 '12 at 16:43
add comment

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.

share|improve this answer
    
I know. Yet both share the same problem... at the end of the day, you have to maintain several virtual environments for all your projects which can get cumbersome very fast. And also, they are totally separate from your dist's package manager... which is both a good and a bad thing (see my posting). Yet I think going the rbenv route may be the only suitable solution for the moment. I just hoped there was a different option... kind of the best of all words. :-) –  khaos Apr 30 '12 at 9:14
    
If you are really planning to run several projects it is the only viable option. Or do you plan to always update every project and make sure they use the same library? –  Timo Zimmermann May 1 '12 at 6:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.