【问题标题】:Capistrano + Git + DreamHostCapistrano + Git + DreamHost
【发布时间】:2010-03-14 15:32:01
【问题描述】:

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

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

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

我目前正在关注这篇文章http://github.com/guides/deploying-with-capistrano 进行部署。

以下是我的 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

当我运行“cap deploy”时,我收到以下错误。

[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)

提前谢谢..

【问题讨论】:

    标签: ruby-on-rails


    【解决方案1】:

    别担心,你最终会得到它的工作,我曾经使用与你自己相同的设置......即 Dreamhost/Passenger/Capistrano/Git(有时是 SVN)- 它可能会很沮丧

    你要做的一些事情:

    1) 阅读 John Nunemaker @ railstips.com 的以下两篇文章 - 我以前每次必须在 Dreamhost 上设置服务器时都会参考它们(第二篇是最重要的,但第一个链接为您提供了一些非常值得遵循的提示)

    1.1) 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”——我会把它改成你自己的名字

    3) 你的域名是 github.com - 同样,这应该是你自己的域名,而不是 github....据我回忆..

    4) 开始使用heroku

    祝你好运 - 希望这会有所帮助,如果有帮助,请告诉我们......

    干杯

    【讨论】:

    • 1) 谢谢。我会看看那些文章。我想我以前读过它们,但是是的。将再次阅读。 2) gituser 就是一个例子。我使用 michaelsync 作为用户名 3) 谢谢。我认为这会有所帮助。更改域后出现权限被拒绝错误。我正在与 Dream Host 联系以解决该问题。 4. 看看也是。。由于DreamHost默认支持Passenger,我现在只想坚持下去。但也会检查heroku ..
    • coolio。如果 github 引起了您的麻烦,只需将您的 git repo 存储在您的 Dreamhost 服务器上,(我在上面发布的第一个链接将向您展示如何做到这一点),这可能会解决它.....
    【解决方案2】:

    您使用您的私有 url 来克隆您的存储库。尝试使用公共克隆 URL

    git://github.com/Myproject.git

    【讨论】:

    • 我在 GitHub 上的项目不是公共项目。所以,我只找到了私人网址。
    【解决方案3】:

    我确实做了 sudo ln -s /opt/ruby/bin/packet_worker_runner /usr/bin/packet_worker_runner”,它解决了问题..

    谢谢。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-08
      • 2012-03-19
      • 2017-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-02
      • 1970-01-01
      相关资源
      最近更新 更多