views:

56

answers:

3

Hello,

I'm trying to deploy my rails application by using Passenger and Capistrano on Dreamhost. I'm using Git as a version control and we bought an account from GitHub.

I have installed all required gems, Passenger and Capistrano in my local machine and I have cloned the repository of my project from GitHub in my local machine as wel.

According to Dreamhost support, they have Passenger, Ruby, Rails and etc on their server as well.

I'm currently following this article http://github.com/guides/deploying-with-capistrano for my deployment.

The following is 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'
#[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

When I run "cap deploy", I'm getting the error below.

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

Thanks in advance..

A: 

You use your private url to clone your repository. Try with public clone URL

git://github.com/Myproject.git

shingara
My project on GitHub is not a public project. So, I found only private URL.
Michael Sync
+1  A: 

Hi, don't worry, you'll get it working in the end, I used to use the very same setup as yourself.... i.e. Dreamhost/Passenger/Capistrano/Git (and at one time, SVN) - it can be quite frustrating

Some things for you to do:

1) Read the following two articles by John Nunemaker @ railstips.com - I used to refer to them every single time I had to setup a server on Dreamhost (the second one is the most important but the first link gives you some tips that are well worth following)

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) I think github is complaining about "gituser" - you do appear to set your username to "gituser" in your capfile - i would change that to your own name

3) you've got your domain down as github.com - again, this should be your own domain name and not github.... From what I recall..

4) start using heroku

good luck - hope this helps, let us know if it does or not....

cheers

stephenmurdoch
1) Thanks. I will take a look at those articles. I think I read them before but yes. will read again.2) gituser is an example. Im using michaelsync as user name 3) Thanks. I think it will help. I got the permission denied error after changing the domain.. I'm contacting with Dream Host about that issue. 4. will look at is as well.. As DreamHost support Passenger by default, I'm just thinking of sticking with it now. but will check heroku too..
Michael Sync
coolio. If github is causing your bother, just store your git repo on your Dreamhost server, (the first link I posted up above will show you how to do that) and that might fix it.....
stephenmurdoch
A: 

i did to do sudo ln -s /opt/ruby/bin/packet_worker_runner /usr/bin/packet_worker_runner” and it solved the problem..

Thanks.

Michael Sync