Automated gem deployment?

Anyone know of a way to automate gem installation/deployment? I’d like
to be able to add the installation of required gems to a kickstart
%post section, to get deployment down to:

  1. kickstart new machine w/ gems
  2. cap deploy to it
  3. no step 3

Currently there’s a step 1.5 of having to go manually install a bunch
of gems, because some gems require you to specify the platform at an
interactive prompt - I can’t see any way to specify it via a command
line argument

A way to either kickstart the appropriate gems or have capistrano
deploy them would be amazing. I read about gem_server, but this
doesn’t seem to help the platform selection issue

Check out this thread:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/189276

So it looks like people are changing that. But for now, based on my
poor memory, you could do either
echo “1” | gem install mongrel
or download all the necessary gem files and install them locally.

On 6/4/07, crayz [email protected] wrote:

interactive prompt - I can’t see any way to specify it via a command
line argument

A way to either kickstart the appropriate gems or have capistrano
deploy them would be amazing. I read about gem_server, but this
doesn’t seem to help the platform selection issue


Jeff X.
Software Journeyman - http://gigix.thoughtworkers.org
Open Source Contributor - http://rubyworks.rubyforge.org
Technical Evangelist - http://www.infoq.com/cn/

For non-platform specific gems, we do, and I’d recommend freezing them
into
your codebase, that way you track them with your code, and they are
simply
there with your app - you never have to worry about the version on a
machine
being out of sync with what your app expects, etc. You can use Rick
Olsen’s
gems plugin to make this easier:
http://agilewebdevelopment.com/plugins/gems

For platform-specific gems, we haven’t quite got this in yet, but we’re
planning to use the same/similar approach as is covered here (see down
in
the comments about the platform specific dirs):
http://errtheblog.com/post/2120

On 6/4/07, crayz [email protected] wrote:

of gems, because some gems require you to specify the platform at an
interactive prompt - I can’t see any way to specify it via a command
line argument

A way to either kickstart the appropriate gems or have capistrano
deploy them would be amazing. I read about gem_server, but this
doesn’t seem to help the platform selection issue


Chris B.
[email protected]

Ya, I really see the freezing thing as the ideal, because then you don’t
need to do anything else when you deploy - you simply deploy using
standard
Capistrano, and you are guaranteed to have the right versions of the
gems
you are using, since they’re right there in your codebase. Otherwise
all
you’re doing is creating more things for you to maintain, potentially
causing pain when Capistrano upgrades come (e.g. if you haven’t moved to
Cap
2.0, it could be some re-work you have to do etc.).

I’m hoping to create a well documented system for the platform specific
gem
stuff, and once I do, I will blog/publish/share it…

On 6/5/07, James H. [email protected] wrote:

James H.

gems plugin to make this easier:

Currently there’s a step 1.5 of having to go manually install a bunch
[email protected]


Chris B.
[email protected]

Very interesting.

I had been using Capistrano to automatically download and install
Gems, aided by the a little tidbit in the VMBuilder plugin. I
actually spent a little bit of last nigth laying down the groundwork
to re-write the methods I used to do this. That said, I’d really
prefer if Piston managed this sort of thing.

James H.

Just an update. This got to really nagging me, and I wound up digging
into the rubygems code a little to see if there was a quick way to
patch the platform-specific gem selection. Turns out there is:
http://pastie.caboo.se/73171

Apply with:
patch /root/platform_gems.patch /usr/lib/ruby/site_ruby/1.8/rubygems/
remote_installer.rb

Probably not a great way to do it, but it’ll hold us over until
rubygems itself has this ability. This hard-codes to ruby as the
platform since that’s all we use anyway, but it’d be pretty trivial to
change the code to check & select instead

  • crayz

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs