2010-03-14 126 views
1

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

我已经在本地机器上安装了所有必需的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' 
#[email protected]:MyProjectOnGit.git 
# the rest should be good 
set :repository, "[email protected]: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) 

在此先感谢..

回答

0

我没有做须藤LN -s /选择/红宝石/斌/ packet_worker_runner在/ usr/bin中/ packet_worker_runner“,它解决了这个问题。

谢谢。

0

你用你的私人网址克隆你的仓库。公共克隆URL尝试

git://github.com/Myproject.git

+0

我在GitHub上的项目不是一个公共项目。所以,我只找到私人网址。 – 2010-03-15 01:44:45

3

不用担心,你会得到它到底有工作,我以前用的是同样的设置为自己....即Dreamhost的/乘客/ Capistrano的/ Git的(并在同一时间,SVN) - 它可以是很令人沮丧

有些事情你做:

1)阅读约翰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

好运 - 希望这可以帮助,让我们知道,如果它还是不....

欢呼

+0

1)谢谢。我会看看那些文章。我想我以前看过他们,但是是的。将再次阅读。 2)gituser就是一个例子。我用michaelsync作为用户名 3)谢谢。我认为这会有所帮助。更改域后,我获得了权限被拒绝的错误..我正在与Dream Host联系,讨论这个问题。 4.看看也是如此。由于DreamHost默认支持Passenger,我只是想着现在就坚持下去。但也会检查heroku .. – 2010-03-15 02:38:48

+0

coolio。如果github引起你的麻烦,只需将你的git repo存储在你的Dreamhost服务器上(我上面发布的第一个链接将告诉你如何做到这一点),并可能解决这个问题..... – stephenmurdoch 2010-03-15 06:10:09