Drops
Drops

Reputation: 2740

Heroku Deployment from multiple win7 64 machines

First of all, I read this question but I still have problems with deploying from multiple machines.

From work everything works like a charm, but from home-machine I have problem pushing to same Heroku app. Both machines are Win7 64, IDE is Rubymine (jumping between integrated git gui and terminal - but no problems with that), Ruby200 and devkit both 32 and 64 (but on separate machines), .ssh keys in C:/users/.ssh/ (on both machines). Git stuff is also working like a charm on both machines. Same heroku acc.

On home machine when I $ heroku keys it lists 2 keys like it should (for work and home machine). Then when I $ git remote add heroku [email protected]:my-app.git I get fatal saying that I already have that remote repository on this machine. I check for remotes $ git remote -v and it lists 2 reps (both github and heroku), like it should, but when I $ git push heroku I get:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists. 

I tried deleting keys, generating new ones both with ssh-keygen -t rsa and heroku keys:add to create after previously removing one and with no luck. Even added it with heroku keys:add C:/path-to-ssh.pub if that specificity even mater.

I know that I can 'cheat' this out with DropBox but I'd rather avoid them and go this way, pulling from Github. Thank you in advance, if more info is needed I will provide it.

Edit: I tried $ heroku create project-with-another-name to create heroku app with same code and it goes through. After I check for that remote via $ git remote -v I don't see it (only old ones), but when I tried to add it with $ git remote add heroku ..., it said to me that remote allready exist and I can see it in Heroku dashboard. $ git push heroku master gives me same error as before.

Upvotes: 2

Views: 148

Answers (2)

Drops
Drops

Reputation: 2740

Solution:

# Generate key 
ssh-keygen -t rsa 

# Start of ssh-agent (I missed this step and
# it didn't added key to my machine even though it 
# created file. In order to do: ssh-add C:/path/to/id_rsa_key 
# I needed to start ssh-agent) 
eval $(ssh-agent)

# Then add private key
ssh-add C:/path/to/id_rsa_key 

cd C:/project

# And finaly send public key to heroku
heroku keys:add C:/path/to/id_rsa_key.pub  

Upvotes: 0

Richard Peck
Richard Peck

Reputation: 76774

The problem seems to be an issue with the local git repos on your system, and how they communicate with the remote Heroku repo.

The issue will either be with the ssh keys on your system, or the remote repos your computer will have (and how you're able to communicate with Heroku properly).

--

Fix

After looking at this question, you may wish to use the following:

Really all I had to do was follow these steps: https://devcenter.heroku.com/articles/keys

First you have to create a key:

ssh-keygen -t rsa

Second you have to add the key to Heroku:

heroku keys:add

--

If that doesn't work, I would get rid of the local git repo & then create a new remote one for use with Heroku:

delete the .git repo for your local app

In the parent / apps directory, run git init [folder_name]

Inside the app folder directly, you can then run [email protected]:project.git

Upvotes: 1

Related Questions