TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

RubyGem is from Mars, AptGet is from Venus

16 pointsby pelleover 16 years ago

11 comments

e1venover 16 years ago
Coincidentally, I'm sitting here staring at a terminal for the few hours because of RubyGems.<p>As a systems administrator, I'm absolutely not a fan of Ruby gems for exactly the reason the article mentions-<p>They're designed to be convenient for the developer, but they make an end-run around all of the methods that we admins set up to make things easy to deploy, and safe to update.<p>For instance- At Darkenedsky, we have a fleet of Ubuntu 6.06 webservers that are configured to run Apache, Postgresql, etc.<p>One of our coders has recently made a change which means that I need to push a library out to all 50+ machines..<p>Normally, this is a pretty trivial affair.<p><pre><code> for i in `cat hostlist`; do ssh $i apt-get install library; done </code></pre> Unfortunately, this particularly library is a Ruby gem, so things aren't nearly as simple ;(<p>The first step is that I need to ssh into each machine, and manually install Rubygems. Rubygems aren't packaged for Ubuntu 6.06, so I need to do a source install and configure.<p>Once it's installed, I need to update gems to have the most recent package definitions, and then I can start to install the package I actually want.<p>So far, it's annoying in that there are several extra steps, but they're scriptable, so it's liveable.<p>Unfortunately, installing the packages isn't very scriptable at all. When I install, I'm presented with a menu-<p><pre><code> Select which gem to install for your platform (i486-linux) 1. fastthread 1.0.1 (i386-mswin32) 2. fastthread 1.0.1 (ruby) 3. fastthread 1.0.1 (mswin32) 4. fastthread 1.0 (ruby) 5. fastthread 1.0 (mswin32) 6. Skip this gem 7. Cancel installation </code></pre> If this were a non-gems library, and/or packaged as a normal Ubuntu release, I wouldn't need to manually choose one of these. I could set my choice in debconf (write it to a file), and then push it out everywhere.<p>If we're dealing with only one machine, like most developers do, this isn't a big deal. It downloads and installs the gem, and you're good to go. But when you're dealing with a fleet of machines, anything that requires manual interaction is a sin against man and god.<p>Debconf allows me to choose whatever level of interaction I want-<p><pre><code> "Ask me all details, even the trivial ones" "Only ask me the important stuff" "Use the choices provided in this file" </code></pre> Why should I need to choose between 1.01 and 1.0 after I start the install?<p>On Ubuntu, if the packages were really so important that both needed to be available, I could choose to install something between<p><pre><code> apt-get install ruby-fastthread-1.0 </code></pre> or<p><pre><code> apt-get install ruby-fastthread-1.1 </code></pre> Again, we're down to one command. Nice and simple, no interaction needed.<p>Further compounding the pain is that this isn't a choice I should even have to make- Why would I want the win32 version of a library on by Linux box?<p>If I'm installing a packaged version, It's already been tested in this configuration, and it's designed to work with everything else on the system.<p>Too many servers give me an error on install-<p><pre><code> Building native extensions. This could take a while... ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError) ERROR: Failed to build gem native extension. </code></pre> While that's certainly fixable, it means that I need to babysit the install far more than I do for something that's properly packaged.<p>After I choose what I want, I get to wait while the package downloads across the public internet.<p>When dealing with Ubuntu, all our servers are pointed at an in-house repository for packages- We keep a copy of everything we need on-site, and I can update it with one command.<p>This means that when installing software, it only has to travel to the server a few racks over, not out the internet at large. With gems, this system is broken- Each one reaches out to the public internet.<p>Not only is this is <i>much</i> slower, but I can't trust that a package is 100% identical.<p>Having one machine be different, even by a point release, can be a guge problem in trying to debug intermittent errors.<p>Finally, upgrading the packages are far more difficult that they have to be.<p>If a bug is discovered in a library, such as the zlib bug that came out a few years ago, I can update it trivially and easily across all the machines.<p>Ubuntu has built-in commands for updating security bugs, and it separates that from updating features.. That way, I don't need to move to the next version of a package, possibly breaking the code, to resolve a security bug.<p>Now, that's not to say that issues with Ruby gems couldn't be fixed.. I'm sure that one by one, they could be addressed- Scripting support could be beefed up, local repositories could be added. Upgrading could be improved, and configuration could be rewritten..<p>But even if they were to fix EVERYTHING on the list, it would still be layering one packaging system atop another, which means that we need to have two ways to do everything.<p>Two sets of config files. Two repositories of packages. Two places for bugs.<p>As the author suggests, the problem comes in that OS packages and Ruby gems are are focused on different audiences-<p>Developers love ruby gems because for the one machine they use to write the code, it's easy, fast, and convenient.<p>Admins hate gems because when you're trying to deal with a fleet of machines, it's none of the above.
评论 #386358 未加载
评论 #386345 未加载
评论 #386425 未加载
评论 #386337 未加载
old-greggover 16 years ago
One of my Rails projects runs <i>only</i> on aptitude-provided gems and it has been a breeze. Yes, I don't get the latest and "hottest" versions of popular gems, but everything <i>works</i> and very reliable.<p>With other project I installed gems and Ruby from the source and have been handling dependencies with RubyGems. Not nearly as smooth: maintaining this mess without google would have been close to impossible. Internet is full of blog posts and article about "installing X on Leopard or upgrading Y on Ubuntu without apt-get". And guess what: those posts make absolutely no sense in an aptitude-controlled environment, where everything just works: the entire system can be re-created with a single apt-get command and a copy of your /etc files.<p>And the author's position of <i>fuck you all</i>, or as he puts it: <i>"I'm all about application, systems management is not my job"</i> is precisely why Windows is such a piece of shit: system management is nobody's job there, everyone is all about "application". This is why after you install a few creations of these "application guys" the whole thing becomes an unusable mess and you start paying attention to "I'm a Mac" commercials.
评论 #386138 未加载
rbanffyover 16 years ago
With Python, which has the easy_install utility for installing its own packages, I use the virtualenv mechanism to create a "shadow" environment connected to the machine's main Python but with its own library/package folders.<p>With that, I am free to install anything I want in the secondary Python, I still have access to distro updates for libraries that I chose not override in my environment and I am completely cool I am not hosing my main Python install.<p>In the unlikely event there is nothing similar to it for Ruby, it would be trivial to develop it.
glebover 16 years ago
I don't believe Debian ever managed to deal with 3rd party package management tools well. E.g. XEmacs has its own package management and apt-get equivalent, and it never worked right in Debian. It's fundamentally hard problem to support different 3rd party release cycles while fulfilling traditional Debian goals of stability and correctness.<p>Having said that the situation is particularly poor in Debian ruby gem land. There are 2 kinds of people -- the ones that understand Unix dynamic library versioning scheme and the ones that do not; the one that understand while non-distribution software needs to go into /usr/local and the ones that don't; the one that understand why Debian needs all the complexity in dependency management and the ones that don't; the ones that understand Unix rule of silence and the ones that don't, etc. Debian and Ruby communities are on the opposite side of this divide.
lsbover 16 years ago
Why can't Central Command for RubyGems just upload any gem it gets as a Debian and RedHat package?
评论 #386920 未加载
gcvover 16 years ago
I deployed one project by creating a completely separate deployment area, /opt/projectname, which contains a separate tree, /opt/projectname/sw, where I manually compiled all the dependencies: ./configure --prefix=/opt/projectname/sw. I installed ruby and gems in there, as well as the specific version of Apache I wanted to use. On the downside, it means that managing upgrades comes problematic, as I have only isolated the bin/lib/etc/share mess into a separate tree, not eliminated it.<p>To make life easier, though, I'd like to use an alternative source-based package manager. I'm not sure how to do this, but I'd like to run the './configure --prefix=/usr &#38;&#38; make &#38;&#38; make install' invocation in an environment which tracks the files copied by the install process, and knows which files in the system my packages affected. At this point, it would (ideally) update the .deb database on the system. It could (alternatively) keep track of these files in its own database. Maybe a chroot trick could help implement this.
评论 #387973 未加载
davidwover 16 years ago
He doesn't address this point at all, calling security concerns 'FUD':<p>With apt-get, you have one thing to keep up to date in order to keep your system secure. It's so easy that you can automate it if needs be. It's also easy to keep track of security updates. With 'gem', now you have two things to keep track of.<p>I currently use apt-get along side the gem stuff to maintain my servers, but it's something I do worry about. I have no hesitation about trusting my servers to Debian or Ubuntu, but gem isn't quite so much a known quantity, and furthermore, I'm not sure the update system distinguishes between security updates and "hey, there's a new version of Rails (or whatever) that might break a bunch of stuff".<p>It's not an easy problem, that goes without saying, but I wouldn't be so quick to dismiss either side.
评论 #386431 未加载
justindzover 16 years ago
I'm currently using gems because I haven't gotten to the level of complexity where it's made any difference. Also, I tend to operate on Windows and Linux interchangeably and using the same approach in each platform is easy. I suppose I might feel differently if I were not doing personal projects and in single user mode.<p>This article did bring up a question I had with Firefox on apt-based systems. Why would I install a Firefox plugin through apt rather than just through Firefox plugins? Is the argument basically the same--that there are fewer/older plugins in apt but they have been proven stable by someone you can decide to trust so you get to choose what you care about most?
评论 #386287 未加载
评论 #386399 未加载
stedwickover 16 years ago
Here's what I don't like about apt-get install on Debian. There is NO DOCUMENTATION. At least, not as far as I can tell.<p>For example, "apt-get install phpmyadmin"... and then what? It took me HOURS to figure out what to do next. There was no message saying, "Congrats, phpmyadmin has been installed in the following directory. Navigate to the following URL to start using it." Nothing. Or what about "apt-get install rails"? I have absolutely NO IDEA what that does. I would never build an application on that rails installation.<p>Rubygems, on the other hand, is unbelievably easy. "gem install whatever" and then in your application "require whatever". What could be simpler?
评论 #394101 未加载
评论 #387943 未加载
dwrightalmost 16 years ago
I'm very late to this party. (not sure if this is still a hot issue)<p>Just thought I'd mention, that there seems to be some work in this area.<p>gem2deb - a gem to a *.deb (Debian/Ubuntu) package <a href="http://github.com/thwarted/gem2deb/tree/master" rel="nofollow">http://github.com/thwarted/gem2deb/tree/master</a><p>(and for rpm's) <a href="http://rubyforge.org/projects/gem2rpm/" rel="nofollow">http://rubyforge.org/projects/gem2rpm/</a><p>a repo for rhel/deb/others <a href="http://rubyworks.rubyforge.org/" rel="nofollow">http://rubyworks.rubyforge.org/</a><p>I'm sure there are others,...
ruby_rooover 16 years ago
How does Debian handle CPAN? Must you rely on apt-get for your Perl modules as well?
评论 #397754 未加载