Capistrano With Rack

ruby capistrano deployment rack

Sun Nov 08 22:23:11 -0800 2009

Savorous, as well as, is built on the Sinatra framework and served via Apache and the Passenger extension, with Rack somewhere in the middle.

By default, the application will be loaded with the production environment unless you specify otherwise. I do so in the application’s rackup file,, like so:

require 'savorous'

set :environment, :development

run Sinatra::Application

But of course that’s not appropriate for production. So I have a second file,, and in my config/deploy.rb, which the Capfile calls, I have:

namespace :configure do
	desc "Putting production rackup file in place"
	task :rackup, :roles => :app do
		run "rm #{File.join(current_path,'')}"
		run "mv #{File.join(current_path,'')} #{File.join(current_path,'')}"

after("deploy:symlink") do

I’m still learning all the ins and outs of Capistrano, so this may not be the best way to do it (though it works). I simply looked for the last task to occur before restart was called and inserted my configure.rackup call there. Good enough!

blog comments powered by Disqus