# Automated gem deployment?

**URL:** <https://www.ruby-forum.com/t/automated-gem-deployment/105911>\
**Category:** Deployment\
**Created:** [June 4, 2007, 4:03pm UTC](https://www.ruby-forum.com/t/automated-gem-deployment/105911 "2007-06-04T16:03:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![crayz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/fbc32d/32.png) [@crayz](https://www.ruby-forum.com/u/crayz)\
**Post date:** [June 4, 2007, 4:03pm UTC](https://www.ruby-forum.com/t/automated-gem-deployment/105911/1 "2007-06-04T16:03:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![crayz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/fbc32d/32.png) [@crayz](https://www.ruby-forum.com/u/crayz)\
**Post date:** [June 4, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/automated-gem-deployment/105911/2 "2007-06-04T16:22:51Z")

</div>

Check out this thread:  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/189276](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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://gigix.thoughtworkers.org)  
Open Source Contributor - [http://rubyworks.rubyforge.org](http://rubyworks.rubyforge.org)  
Technical Evangelist - [http://www.infoq.com/cn/](http://www.infoq.com/cn/)

---

<div class="post-metadata">

**Author:** ![crayz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/fbc32d/32.png) [@crayz](https://www.ruby-forum.com/u/crayz)\
**Post date:** [June 5, 2007, 6:28am UTC](https://www.ruby-forum.com/t/automated-gem-deployment/105911/3 "2007-06-05T06:28:38Z")

</div>

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](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](http://errtheblog.com/post/2120)

On 6/4/07, crayz [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![crayz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/fbc32d/32.png) [@crayz](https://www.ruby-forum.com/u/crayz)\
**Post date:** [June 5, 2007, 5:54pm UTC](https://www.ruby-forum.com/t/automated-gem-deployment/105911/4 "2007-06-05T17:54:55Z")

</div>

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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> James H.
> 
> > gems plugin to make this easier:
> > 
> > > Currently there’s a step 1.5 of having to go manually install a bunch  
> > > removed\_email\_address@domain.invalid
> 
> >

–  
Chris B.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![crayz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/fbc32d/32.png) [@crayz](https://www.ruby-forum.com/u/crayz)\
**Post date:** [June 5, 2007, 4:23pm UTC](https://www.ruby-forum.com/t/automated-gem-deployment/105911/5 "2007-06-05T16:23:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![crayz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/fbc32d/32.png) [@crayz](https://www.ruby-forum.com/u/crayz)\
**Post date:** [June 25, 2007, 5:23am UTC](https://www.ruby-forum.com/t/automated-gem-deployment/105911/6 "2007-06-25T05:23:35Z")

</div>

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](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
