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:
kickstart new machine w/ gems
cap deploy to it
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
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.
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
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
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
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…
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.
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
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.