"cap staging deploy" aborted

#1

Hi,

I’m trying to deploy on a server.
config.yml is as follows.

  deploy:
    docker:
      - image: circleci/ruby

    steps:
      - checkout
      - add_ssh_keys:
          fingerprints:
            - xxxxxxxxxxxxxxxxxxxxxxxxxxx

      - deploy:
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              gem install capistrano
              gem install capistrano-ext
              cap production deploy
            fi

      - deploy:
          command: |
            if [ "${CIRCLE_BRANCH}" == "staging" ]; then
              gem install capistrano
              gem install capistrano-ext
              cap staging deploy
            fi

The deploy of the master branch was successful.
but, staging is aborted.

Error message is as follows.

cap aborted!
Don’t know how to build task ‘staging’ (See the list of available tasks with rake --tasks)

(See full trace by running task with --trace)
Exited with code 1

Deployment from my local environment is successful with this code.
However, CircleCI does not succeed.
What should I do?

#2

I would suggest getting an SSH session and trying rake --tasks as it suggests. Does Capistrano require a config file that is not available in this environment?