简体   繁体   English

Bitbucket 管道:bash:cap:找不到命令

[英]Bitbucket pipeline: bash: cap: command not found

I am using rubber to deploy my Symfony project to Digital Ocean.我正在使用 Rubber 将我的 Symfony 项目部署到 Digital Ocean。 The project is hosted on bitbucket.该项目托管在 bitbucket 上。

This is my Capfile.这是我的 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.尝试从服务器中删除 capistrano,但它也不起作用。

The previous steps of capistrano - gem install bundler , and bundle install works without error. capistrano - gem install bundlerbundle install的前面步骤没有错误。

I am new to rubber and bitbucket pipeline, so maybe I missed something here?我是橡胶和 bitbucket 管道的新手,所以也许我在这里错过了一些东西?

Just got to know that the bitbucket pipeline is being executed on a docker image.刚刚知道 bitbucket 管道正在 docker 映像上执行。 Then is this the problem with the bitbucket?那么这是bitbucket的问题吗?

Okay.好的。 I managed to solve this problem by changing cap staging deploy to bundle exec cap staging deploy .我设法通过将cap staging deploy更改为bundle exec cap staging deploy来解决这个问题。 Not sure why this could solve the problem, but anyway it works now.不知道为什么这可以解决问题,但无论如何它现在有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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