简体   繁体   中英

Bitbucket pipeline: bash: cap: command not found

I am using rubber to deploy my Symfony project to Digital Ocean. The project is hosted on bitbucket.

This is my Capfile.

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/symfony'
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git
Dir.glob('deploy/tasks/*.rake').each { |r| import r }

The pipeline was working well, but suddenly stopped working raising this error.

cap staging deploy
+ cap staging deploy
bash: cap: command not found

I tried reverting the commits, but it didn't help. Tried removing capistrano from the server, but it also didn't work.

The previous steps of capistrano - gem install bundler , and bundle install works without error.

I am new to rubber and bitbucket pipeline, so maybe I missed something here?

Just got to know that the bitbucket pipeline is being executed on a docker image. Then is this the problem with the bitbucket?

Okay. I managed to solve this problem by changing cap staging deploy to bundle exec cap staging deploy . Not sure why this could solve the problem, but anyway it works now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM