Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9297411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:04:36+00:00 2026-06-18T22:04:36+00:00

I’ve done this a few times in the past for other projects and eventually

  • 0

I’ve done this a few times in the past for other projects and eventually get it working, but each time I can’t seem to remember exactly what to do.

I have an ec2 ubuntu server and am deploying with capistrano and have used rubber to set evertyhing up.

On my ec2 server, I’ve generated ssh keys, added to bitbucket (under my accounts, ssh key. at first i tried under the project and deployment keys, but that didn’t work either). On my ec2 server, I can successfully manually ssh in and clone my repo into my home directly. I’ve added the key to ssh agent.

I can deploy just fine if I do not use scm and set deploy_via to :copy. I believe this grabs my local project and deploys it.

I’ve read these: https://confluence.atlassian.com/display/BITBUCKET/Using+Deployment+Keys
https://confluence.atlassian.com/display/BITBUCKET/Troubleshooting+SSH+Issues
https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678

This works fine:

ubuntu@production:~$ ssh -T hg@bitbucket.org
conq: logged in as myBitBucketUser.

You can use git or hg to connect to Bitbucket. Shell access is disabled.

Here’s the error message I get during deploy:

* executing "if [ -d /mnt/myProject-production/shared/cached-copy ]; then cd /mnt/myProject-production/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard f2b5b8b6cd1c7835d020d66fdc09b42b2870561e && git clean -q -d -x -f; else git clone -q git@bitbucket.org:myRepo.git /mnt/myProject-production/shared/cached-copy && cd /mnt/myProject-production/shared/cached-copy && git checkout -q -b deploy f2b5b8b6cd1c7835d020d66fdc09b42b2870561e; fi"
    servers: ["production.myserver.com"]
    [production.myserver.com] executing command
 ** [production.myserver.com :: out] Permission denied (publickey).
 ** fatal: The remote end hung up unexpectedly

Here’s my deploy.rb:

set :rails_env, Rubber.env

on :load do
  set :application, rubber_env.app_name
  set :runner,      rubber_env.app_user
  set :deploy_to,   "/mnt/#{application}-#{Rubber.env}"
  set :copy_exclude, [".git/*", ".bundle/*", "log/*", ".rvmrc"]
end

# Use a simple directory tree copy here to make demo easier.
# You probably want to use your own repository for a real app
#set :scm, :none
#set :repository, "."
#set :deploy_via, :copy

ssh_options[:forward_agent] = true # also tried false
set :repository, "git@bitbucket.org:myProject.git"
set :scm, "git"
set :deploy_via, :remote_cache
set :branch, 'master'

# Easier to do system level config as root - probably should do it through
# sudo in the future.  We use ssh keys for access, so no passwd needed
set :user, 'root'
set :password, nil

# Use sudo with user rails for cap deploy:[stop|start|restart]
# This way exposed services (mongrel) aren't running as a privileged user
set :use_sudo, false # also tried true
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:04:38+00:00Added an answer on June 18, 2026 at 10:04 pm

    I ran into this problem using rubber as well.

    If you have multiple instances you’ll need to get SSH keys for all instances as rubber will deploy the code to all. Haven’t found a way to prevent this.

    The ssh keys to use are under ~/.ssh or /root/.ssh if you the keys you generated are in a different directory or under a different user they are probably not being recognized as rubber deploys using the user ‘root’ and that’s the user fetching from the repo.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.