0

After creating my rails project, pushing it into the GIT repo, was not able to push it to Heroku. When I run the command:

git push heroku master

I get this error:

ssh: connect to host heroku.com port 22: Bad file number
fatal: Could not read from remote repository.

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

what's wrong with it?

  • That suggests you are unable to access port 22 on Heroku. Are you behind a corporate firewall perhaps? – John Beynon May 08 '13 at 08:47
  • Related: http://stackoverflow.com/q/7144811/1615903 – 1615903 May 08 '13 at 08:50
  • @user1615903 I do the config, but It still can't work,,when I type $ssh -T heroku.com, it says 'ssh: connect to host ssh.heroku.com port 443: Bad file number'. – LeightonMa May 08 '13 at 10:02
  • @John Beynon , After stopping the firewall,it still can't work. But when I access the github.com by port 22. It have no problem. – LeightonMa May 08 '13 at 10:13

1 Answers1

1

Heroku now has beta HTTP Git support. If the problem is caused by you being unable to access Heroku on port 22, then HTTP Git should solve it (it works on port 443).

To use HTTP Git, first make sure Toolbelt is updated and that your credentials are current:

$ heroku update
$ heroku login

(this is important because Heroku HTTP Git authenticates in a slightly different way than the rest of Toolbelt)

During the beta, you get HTTP by passing the --http-git flag to the relevant heroku apps:create, heroku git:clone and heroku git:remote commands. To create a new app and have it be configured with a HTTP Git remote, run this:

$ heroku apps:create --http-git

To change an existing app from SSH to HTTP Git, simply run this command from the app’s directory on your machine:

$ heroku git:remote --http-git
Git remote heroku updated

Check out the Dev Center documentation for details on how set up HTTP Git for Heroku.

friism
  • 19,068
  • 5
  • 80
  • 116