Capistrano deployment, resource pipeline, ruby-debug not found

I am deploying a Rails 3.2.2, Ruby 1.9.3 application with Capistrano on a Linux server. When I run cap deploy, I get this error:

  * executing `deploy:assets:precompile'
  * executing "cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
    servers: ["example.com"]
    [example.com] executing command
    [example.com] sh -c 'cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'
 ** [out :: example.com] rake aborted!
 ** [out :: example.com] cannot load such file -- ruby-debug
 ** [out :: example.com] 
 ** [out :: example.com] (See full trace by running task with --trace)
    command finished in 8962ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/www/production/releases/20120418090209; true"
    servers: ["example.com"]
    [example.com] executing command
    [example.com] sh -c 'rm -rf /var/www/production/releases/20120418090209; true'
    command finished in 176ms
failed: "sh -c 'cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on example.com

It says that the stone was ruby-debugnot found. But ruby-debug is not inside the production group in my Gemfile:

group :development, :test do
  gem "steak"
  gem "linecache19", :git => "git://github.com/mark-moseley/linecache", :require => "ruby-debug"
  gem "ruby-debug-base19x", "~> 0.11.30.pre4"
  gem "ruby-debug19"
  gem "rails_best_practices"
  gem "ruby_parser"
  gem "reek"
  gem "flog"
  gem "jslint_on_rails", :git => "git://github.com/psionides/jslint_on_rails"
  gem "jasmine-rails"
end

The reason the error occurs after the command rake assets:precompile, I think it has something to do with Capistrano and a call load 'deploy/assets'inside my Capfile:

load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['config/deploy/recipes/*.rb','vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'

When I delete this line, everything unfolds perfectly, but (of course) the assets are not in production. And, if I run bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompiledirectly on the server (inside the app directory), I get the same error.

So what should I do?

+3

All Articles