Rails, Capistrano, and Ruby extension dependencies
26 Mar 2008
Sometimes if I hose up a Ruby install it won't have zlib or openssl or readline compiled in, which produces problems later when I try to get a Rails app running on there. But with a little code we can get Capistrano to check for Ruby extensions (or, really, Ruby libraries in general) via the deploy:check task.
Here's the new RemoteDependency implementation; you can just put this in your deploy.rb:
Here's how to declare instances of this new dependency type; these go in deploy.rb also. Note that we're only checking for these dependencies on the app server; you may not even have Ruby installed on your web servers:
And here's a sample run:
Note the boilerplate deploy:check commands up front followed by the custom checks for the libraries. As always, many thanks to Jamis Buck for Capistrano!