A
A
Anton Misyagin2015-09-07 12:23:16
Ruby on Rails
Anton Misyagin, 2015-09-07 12:23:16

How to run a rake task through capistrano?

it works in development, I run it from the project folder:
rake resque:work QUEUE=*, now the same thing is only in production, on the server via capistrano

namespace :processes do
  desc 'Запуск rake resque:work QUEUE=*'
  task :resque do
    on roles :all do
      within release_path do
        execute :rake, "resque:work QUEUE=*"
      end
    end
  end
end

In the capistrano logs:
Command: cd /var/www/myproject/releases/2015xxxx && /usr/bin/env rake resque:work QUEUE=*
/usr/bin/env:
rake
:Нет такого файла или каталога

And indeed it does not exist, but why does it climb there in this is my question?
Which setting corresponds to where the execute command is executed from?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikiforov, 2015-09-07
@eoffsock

This won't help you, will it? https://github.com/sshingler/capistrano-resque
About execute: you need to pull rake via bundle exec, I think. Have a look at this: https://github.com/capistrano/bundler/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question