Skip to content

Instantly share code, notes, and snippets.

@jmcnevin
Created March 24, 2011 19:04
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmcnevin/885637 to your computer and use it in GitHub Desktop.
Save jmcnevin/885637 to your computer and use it in GitHub Desktop.
Rails 3, Devise, Resque, Capistrano, and static resque-web assets
# I'm currently using Devise along with Resque's resque-web UI. I have resque-web running
# as an embedded rack application inside of my main Rails app with the following line in my
# my routes.rb file:
#
# mount Resque::Server.new, :at => "/resque"
#
# This makes resque-web expect its static assets to be found in your site's /public/resque
# folder, where they won't be.
#
# The answer is to copy or symlink to those assets which are found in the gem's own public
# directory. The following capistrano task will take care of that for you.
#
# This recipe assumes you're using Bundler.
desc "Copy resque-web assets into public folder"
task :copy_resque_assets do
target = File.join(release_path,'public','resque')
run "cp -r `cd #{release_path} && bundle show resque`/lib/resque/server/public #{target}"
end
after "deploy:restart", "deploy:copy_resque_assets"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment