Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/67.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 bitbucket存储库使用capistrano部署rails应用程序时出现问题_Ruby On Rails_Deployment_Capistrano_Bitbucket_Rvm Capistrano - Fatal编程技术网

Ruby on rails bitbucket存储库使用capistrano部署rails应用程序时出现问题

Ruby on rails bitbucket存储库使用capistrano部署rails应用程序时出现问题,ruby-on-rails,deployment,capistrano,bitbucket,rvm-capistrano,Ruby On Rails,Deployment,Capistrano,Bitbucket,Rvm Capistrano,获取bitbucket存储库的github 无法确定主机“github.com(某些ip地址)”的真实性 这是我的部署文件部署:设置和部署:检查工作正常 require "bundler/capistrano" require "rvm/capistrano" default_run_options[:pty] = true ssh_options[:forward_agent] = true set :repository, 'ssh://git@bitbucket.org/usern

获取
bitbucket
存储库的
github

无法确定主机“github.com(某些ip地址)”的真实性

这是我的部署文件<代码>部署:设置和
部署:检查
工作正常

require "bundler/capistrano" 
require "rvm/capistrano"

default_run_options[:pty] = true 
ssh_options[:forward_agent] = true

set :repository, 'ssh://git@bitbucket.org/username/repo.git' 
set :scm :git 
set :scm_verbose, true
set :user, 'root'
set :deploy_via, :remote_cache
set :migrate_target, :current
set :branch, 'master'
set :application, 'my_app_name' 
set :domain, 'my_domain_ip_address'
set :applicationdir, "/home/deploy/domains/#{application}"
set :deploy_to, "/home/deploy/domains/#{application}"
role :web, domain role :app, domain role :db,  domain, :primary => true
set :keep_releases, 5
set :rvm_type, :system

after 'deploy:restart', 'deploy:cleanup'

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')}"
    run "#{try_sudo} chmod 777 #{File.join(current_path,'tmp/')}"
    run "#{try_sudo} chmod 777 #{File.join(current_path,'log/')}"
  end
  task :after_deploy do
    run "cd #{current_path} && bundle install --deployment"
    run "cd #{current_path}; RAILS_ENV=#{rails_env} bundle exec rake db:migrate"
    run "#{try_sudo} chmod 777 -R #{current_path}/tmp/"
    run "#{try_sudo} chmod 777 -R #{current_path}/log/"
    run "#{try_sudo} chmod 777 . #{current_path}/log/"   
  end 
end

after 'deploy', 'deploy:after_deploy'
注意:我第一次尝试部署rails应用程序

服务器:数字海洋VPS

Repository:bitbucket.org

我在
bitbucket
帐户中添加了
server
ssh密钥

问题:在执行“cap:deploy”时,在执行“deploy”之后,deploy:update,deploy:update\u code,deploy:finalize\u update,deploy:assets:symlink,


执行
'bundle install'
时遇到问题,它要求的是
github
真实性,而我使用的是
bitbucket

请尝试这样设置
git URL

set :repository, 'git@bitbucket.org:username/repo.git'

如果尚未将
键添加到bitbucket,可以在此处执行
https://bitbucket.org/account/user/username/ssh-keys/

由于它已经在运行
捆绑安装
很可能您的代码已经成功提取。您是否有任何链接到github repo而不是rubygems.org的gem?是的,代码已部署,它正在向github询问真实性,我没有,也不需要。如果我在那里按ctlr+c,它将删除该版本,并且没有创建“当前”文件夹。有一个gem指向github。正如我所说的……如果有一个gem指向github repo,那么当然你需要将github添加到Known中,我将来自服务器的ssh密钥添加到我的github帐户中。当我尝试时,我得到了这个错误<代码>命令git ls remotessh://git@bitbucket.org:username/repo.git master返回状态代码pid 5264 exit 128
您是否已将ssh密钥添加到bitbucket?是的,我已添加到bitbucket和github。我现在没有犯错误。在遵循j03w的第一条评论之后。现在我得到rvm_路径错误。我要试试那东西<代码>失败:“rvm_path=/usr/local/rvm//usr/local/rvm/bin/rvm shell'default'-c'cd--/home/deploy/domains/app_name/releases/20130910084427&&RAILS_ENV=生产RAILS_GROUPS=资产包exec rake资产:precompile'”位于域的ip地址上