Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Capistrano部署问题_Windows_Linux_Ruby On Rails 3_Rake_Capistrano - Fatal编程技术网

Windows Capistrano部署问题

Windows Capistrano部署问题,windows,linux,ruby-on-rails-3,rake,capistrano,Windows,Linux,Ruby On Rails 3,Rake,Capistrano,我正在尝试让Capistrano部署脚本工作,在我的部署文件中,我有以下内容 set :application, "example.com" role :app, "root@12.34.56.789" role :web, "root@12.34.56.789" role :db, "root@12.34.56.789", :primary => true set :user, "root" set :deploy_to, "/example/www/#{application}"

我正在尝试让Capistrano部署脚本工作,在我的部署文件中,我有以下内容

set :application, "example.com"
role :app, "root@12.34.56.789"
role :web, "root@12.34.56.789"
role :db,  "root@12.34.56.789", :primary => true

set :user, "root"
set :deploy_to, "/example/www/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :keep_releases, 10

namespace :deploy do
  desc "Tell Passenger to restart the app."
  task :restart do
    run "touch #{current_path}/tmp/restart.txt"
  end

  desc "Symlink shared configs and folders on each release."
  task :symlink_shared do
    run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
    run "ln -nfs #{shared_path}/assets #{release_path}/public/assets"
  end

  desc "Sync the public/assets directory."
  task :assets do
    system "rsync -vr --exclude='.DS_Store' public/assets #{user}@#{application}:#{shared_path}/"
  end
end

after 'deploy:update_code', 'deploy:symlink_shared'
此外,我在部署文件中有一个github位置和scm变量。当我运行
cap deploy
时,它启动ok,为github private repo请求用户名/密码,我输入它,可以。然后,在成功并正确提取代码后,我得到以下结果

set :application, "example.com"
role :app, "root@12.34.56.789"
role :web, "root@12.34.56.789"
role :db,  "root@12.34.56.789", :primary => true

set :user, "root"
set :deploy_to, "/example/www/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :keep_releases, 10

namespace :deploy do
  desc "Tell Passenger to restart the app."
  task :restart do
    run "touch #{current_path}/tmp/restart.txt"
  end

  desc "Symlink shared configs and folders on each release."
  task :symlink_shared do
    run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
    run "ln -nfs #{shared_path}/assets #{release_path}/public/assets"
  end

  desc "Sync the public/assets directory."
  task :assets do
    system "rsync -vr --exclude='.DS_Store' public/assets #{user}@#{application}:#{shared_path}/"
  end
end

after 'deploy:update_code', 'deploy:symlink_shared'
执行“如果[-d/example/www/example.com/shared/cached-copy]; 然后是cd/example/www/example.com/shared/cached-copy&&git fetch-q origin&&git fetch--tags-q origin&&git reset-q--hard 93e3432103327f29a9e66fa2755562bfe9bc4412&吉特清洁-q-d-x-f; else git克隆-q /示例/www/social u.com/shared/cached-copy&&cd /示例/www/example.com/shared/cached-copy&&git checkout-q-b 部署93e3432103327f29a9e66fa2755562bfe9bc4412;fi“ 服务器:[“12.34.56.789”]密码:

所以它需要一个密码。我猜这是给宋承宪的。我输入根用户的密码,但它无法显示此

    [12.34.56.789] executing command
 ** [12.34.56.789 :: err] Username:
我也试着根本不输入密码,我得到了以下结果

Capistrano::ConnectionError,连接失败 (Net::SSH::AuthenticationFailed:根)


问题是我输入了正确的ssh密码。。。我可以用腻子把它修好。顺便说一句,我在本地windows pc上运行cap deploy,远程设备是linux设备。当然我的位置不是12.34.56.78,但你明白了。关于如何解决这个问题有什么想法吗

您需要使用GitHub的SSH url,而不是https url。

通过将用户更改为非根用户来解决此问题

这消除了第一次密码检查,这很好,但问题中提到的第二次密码检查出于某种原因仍在显示。我将接受您的回答,因为这有助于消除第一次密码检查,谢谢:)