代码之家  ›  专栏  ›  技术社区  ›  Michael Sync

Capistrano+Git+梦想主机

  •  1
  • Michael Sync  · 技术社区  · 16 年前

    我正试图通过在Dreamhost上使用Passenger和Capistrano来部署我的rails应用程序。我使用Git作为版本控制,我们从GitHub购买了一个帐户。

    我已经在本地机器上安装了所有必需的gems、Passenger和Capistrano,并且从本地机器上的GitHub克隆了项目的存储库。

    根据Dreamhost支持,他们的服务器上也有Passenger、Ruby、Rails等。

    http://github.com/guides/deploying-with-capistrano 为了我的部署。

    下面是my deploy.rb。

    default_run_options[:pty] = true
    ssh_options[:forward_agent] = true
    
    # be sure to change these
    set :user, 'gituser'
    set :domain, 'github.com'
    set :application, 'MyProjectOnGit'
    #git@github.com:MyProjectOnGit.git
    # the rest should be good
    set :repository,  "git@github.com:MyProjectOnGit.git"
    set :deploy_to, "/ruby.michaelsync.net/"
    set :deploy_via, :remote_cache
    set :scm, 'git'
    set :branch, 'master'
    set :git_shallow_clone, 1
    set :scm_verbose, true
    set :use_sudo, false
    set :git_enable_submodules, 1
    server domain, :app, :web
    role :db, domain, :primary => true
    
    set :ssh_options, { :forward_agent => true }
    
    namespace :deploy do
      task :restart do
        run "touch #{current_path}/tmp/restart.txt"
      end
    end
    

    [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: github.com (Net::SSH::AuthenticationFailed: gituser) connection failed for: github.com (Net::SSH::AuthenticationFailed: gituser)
    

    3 回复  |  直到 16 年前
        1
  •  3
  •   stephenmurdoch    16 年前

    别担心,你最终会成功的,我以前用的和你一样的设置。。。。i、 e.Dreamhost/Passenger/Capistrano/Git(曾经是SVN)——这可能会让人非常沮丧

    1) 阅读以下两篇由John Nunemaker@railstips.com撰写的文章-我以前每次在Dreamhost上安装服务器时都会参考它们(第二篇文章是最重要的,但第一篇链接提供了一些非常值得关注的提示)

    http://railstips.org/blog/archives/2008/11/23/gitn-your-shared-host-on/ 1.2) http://railstips.org/blog/archives/2008/12/14/deploying-rails-on-dreamhost-with-passenger/

    2) 我认为github抱怨的是“gituser”——你在capfile中似乎把用户名设置为“gituser”——我会把它改成你自己的名字

    4) 开始使用heroku

    祝你好运-希望这有帮助,让我们知道它是否。。。。

        2
  •  0
  •   shingara    16 年前

    您可以使用专用url克隆存储库。尝试使用公共克隆URL

    git://github.com/Myproject.git

        3
  •  0
  •   Michael Sync    16 年前

    我做了sudo-ln-s/opt/ruby/bin/packet\u worker\u runner/usr/bin/packet\u worker\u runner,它解决了这个问题。。