我正在使用Capistrano 3.过去我可以成功部署到我的服务器。
现在服务器已迁移并具有新参数:
authorized_keys
无密码连接)staging.rb
和SSH凭据)cap
可以连接到我的新服务器,因此Auth看起来很好。current
目录但是,使用cap staging deploy
时出现错误:
SSHKit::Command::Failed: if test ! -d /var/www/my-project/subdomains/dev/current; then echo "Directory does not exist '/var/www/my-project/subdomains/dev/current'" 1>&2; false; fi exit status: 1
我查了一下好奇的current
目录仍在那里(与其他目录一起迁移)。我删除了current
目录,因为这将在部署中创建(我当时认为)。
在下次部署时,我遇到了同样的错误。所以我做了一些谷歌搜索,最后我添加了以下钩子:
# Had to insert this hook after migrating the server
# Maybe this can be removed after the first successful deployment
after 'deploy:set_current_revision', 'deploy:symlink:release'
我认为这不是一个非常干净的方法,但从那时起current
目录已经创建,我与cap staging deploy
的距离更远。
现在每当我设置Capistrano时,我都惊讶于它的工作原理是多么轻松,但是现在我已经搬到了另一台服务器上,我一直遇到问题。
我想知道:
deploy.rb
或staging|production.rb
配置环境?答案 0 :(得分:0)
我设法修复了我的部署,我不确定我采取的哪些步骤确实是必需的。 我在此SO帖子中记录了解决方案:Bundler in deployment mode does not find Gems