capistrano部署失败 - 致命:需要一次修订

时间:2015-07-08 09:21:13

标签: ruby-on-rails git capistrano

我尝试通过'bundle exec cap production deploy'将我的应用部署到VPS,但是我收到错误

BCrypt

我的远程git存储库只包含一个分支 - master,我不知道导致此错误的原因:(

远程git版本是1.9.1

本地git是1.9.5.msysgit.1

deploy.rb:

Tasks: TOP => git:create_release => git:update
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing as deploy@178.57.217.128
: cd /var/www/repo && git rev-parse --short HEAD exit status: 128
cd /var/www/repo && git rev-parse --short HEAD stdout: Nothing written
cd /var/www/repo && git rev-parse --short HEAD stderr: fatal: Needed a single revision

# config valid only for Capistrano 3.1 lock '3.1.0' set :application, 'stroysauna_pg' set :repo_url, 'git@github.com:IvanSelivanov/stroysauna_pg.git' namespace :deploy do desc 'Restart application' task :restart do on roles(:app), in: :sequence, wait: 5 do # Your restart mechanism here, for example: execute :touch, release_path.join('tmp/restart.txt') end end after :publishing, :restart after :finishing, 'deploy:cleanup' after :restart, :clear_cache do on roles(:web), in: :groups, limit: 3, wait: 10 do # Here we can do anything such as: # within release_path do # execute :rake, 'cache:clear' # end end end end

.git\config

从头开始创建一个空的应用程序 - 仍然没有部署,同样的错误 https://github.com/IvanSelivanov/vps

2 个答案:

答案 0 :(得分:0)

不完全是一个解决方案,但它确实有效。从头开始重建服务器,但使用rbenv而不是rvm。现在它部署没有错误。

答案 1 :(得分:0)

重命名/删除repo文件夹,然后使用Capistrano重新部署。不知道是什么原因导致了这个问题,但这对我来说很容易解决。