Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.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
Ruby on rails Capistrano给出DNS欺骗警告,尽管我可以很好地使用SSH_Ruby On Rails_Ssh_Capistrano - Fatal编程技术网

Ruby on rails Capistrano给出DNS欺骗警告,尽管我可以很好地使用SSH

Ruby on rails Capistrano给出DNS欺骗警告,尽管我可以很好地使用SSH,ruby-on-rails,ssh,capistrano,Ruby On Rails,Ssh,Capistrano,我有一个Rails应用程序,我正试图用Capistrano部署它(我今天以前从未使用过)。当我运行cap deploy时,会收到DNS欺骗警告。我已经粘贴了输出 即使我删除~/.ssh/known_hosts,我仍然会收到欺骗警告。此外,我可以SSH到我的服务器上,没有任何欺骗警告。(我已设置RSA密钥。) 知道为什么会这样吗?这是我的config/deploy.rb: require "bundler/capistrano" set :user, "jason" set :domain, "

我有一个Rails应用程序,我正试图用Capistrano部署它(我今天以前从未使用过)。当我运行
cap deploy
时,会收到DNS欺骗警告。我已经粘贴了输出

即使我删除
~/.ssh/known_hosts
,我仍然会收到欺骗警告。此外,我可以SSH到我的服务器上,没有任何欺骗警告。(我已设置RSA密钥。)

知道为什么会这样吗?这是我的
config/deploy.rb

require "bundler/capistrano"

set :user, "jason"
set :domain, "sniphq.com"
set :application, "Snip"
set :repository,  "ssh://jason@sniphq.com/var/git/snip.git"

set :scm, "git"
set :branch, "master"
set :git_shallow_clone, true
set :scm_verbose, true

role :web, domain                          # Your HTTP server, Apache/etc
role :app, domain                          # This may be the same as your `Web` server
role :db,  domain, :primary => true # This is where Rails migrations will run

set :deploy_to, "/home/jason/snip-cap"
set :deploy_via, :export

# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts

# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end
end
从克隆您的回购协议时,您的服务器sniphq.com正在尝试访问自身

ssh://jason@sniphq.com/var/git/snip.git

如果已知的_主机包含该名称的不同ip,这也可能导致警告


尝试删除服务器上的
/home/jason/.ssh/known_hosts
,或者简单地删除那里的第3行。

此外,我最终将其从
ssh://jason@sniphq.com/var/git/snip.git
到just
/var/git/snip.git
。把服务器SSH放在自己身上感觉有点奇怪。这很好。不知道您是否也正在部署到另一台服务器。那就有意义了。