gpt4 book ai didi

ruby-on-rails-4 - Capistrano 使用错误的发布路径

转载 作者:行者123 更新时间:2023-12-04 19:16:43 24 4
gpt4 key购买 nike

我的 deploy.rb文件看起来像这样

  SSHKit.config.command_map[:rake] = "bundle exec rake"

lock '3.2.1'

set :application, 'foobar'
set :scm, :git
set :repo_url, 'git@bitbucket.org:xxxx/xxxx.git'

set :deploy_via, "copy"
set :ssh_options, { forward_agent: true }

set :assets_roles, [:web]
set :whenever_roles, [:cron]

set :format, :pretty

set :pty, true

set :linked_files, fetch(:linked_files, []).push('config/database.yml')

set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/assets', 'public/system', 'public/uploads')

set :keep_releases, 5

set :rvm_type, :user
set :rvm_ruby_version, '2.2.3@xxxx'

set :nvm_type, :user
set :nvm_node, 'v0.12.4'
set :nvm_map_bins, %w{node npm}
set :nvm_roles, [:web]

set :bundle_path, nil
set :bundle_binstubs, nil
set :bundle_flags, '--system'

namespace :deploy do

after :restart, :clear_cache do
on roles(:app) do
within current_path do
with rails_env: fetch(:rails_env) do
execute :rake, 'db:schema:load'
end
end
end
end

end

但是当我尝试做 cap production deploy我收到以下错误
    DEBUG [56b32b4c] Running /usr/bin/env if test ! -d /var/www/omega/current; then echo "Directory does not exist '/var/www/omega/current'" 1>&2; false; fi as deploy@XX.XX.XXX.X
DEBUG [56b32b4c] Command: if test ! -d /var/www/xxxx/current; then echo "Directory does not exist '/var/www/xxxx/current'" 1>&2; false; fi
DEBUG [56b32b4c] Directory does not exist '/var/www/xxxx/current'
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@XX.XX.XXX.X: if test ! -d /var/www/xxxx/current; then echo "Directory does not exist '/var/www/xxxx/current'" 1>&2; false; fi exit status: 1

我不明白它出了什么问题,我已经花了很多时间来调试错误,但还没有成功。

最佳答案

这种特殊情况的原因是,current符号链接(symbolic link)已死。表示它指向的目录以某种方式被删除。

那么为什么 Capistrnao 命令会导致错误 Directory does not exists .

关于ruby-on-rails-4 - Capistrano 使用错误的发布路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35193200/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com