36

I cloned a project from github over to my desktop. I used to work on it form my laptop.

However, on laptop heroku does not seem to work for this app eventhough i have it installed.

First problem:

heroku open
>No app specified.
>Run this command from app folder or set it adding --app <app name>

I did not have to specify the --app on my laptop. Because I guess I did command heroku create initially on the lapop.

Second Probelm:

git push heroku master

gives errors

fatal: 'heroku' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

and heroku list

says

 !   This version of the heroku gem has been deprecated.
 !   Please update it by running: gem update heroku
ratan
  • 395
  • 1
  • 4
  • 6

4 Answers4

71

First do:

git remote add heroku git@heroku.com:{my-project-name}.git

Where you replace {my-project-name} with the name of the Heroku application as it appears in your Heroku account. For example, if your Heroku account says you have an application named flowing-water-397, then the line would be:

git remote add heroku git@heroku.com:flowing-water-397.git

Then Git and the Heroku gem will know that this Git repo is connected to a Heroku.com application. Then you can do things such as:

git push heroku master
heroku open

Finally, learn a little bit more about Git Remotes.

yfeldblum
  • 65,165
  • 12
  • 129
  • 169
  • for a moment i kept thinking {my-project-name} was the project of myapp on my local host. im glad your answer somehow stuck out to me to use the project name on the heroku repo haha. thanks. thumbs up – Sasha Feb 29 '12 at 21:16
  • I couldn't even run 'heroku run bash' until I did this. We had been setting up a new project to deploy through CodeShip so had not needed to configure our git for Heroku. Now it works. – ChrisPhoenix Nov 13 '13 at 00:39
9

In addition to the git remote add ... that @Justice mentioned, I also needed to run

git config heroku.remote heroku

(solution found here)

Aidan Feldman
  • 5,205
  • 36
  • 46
4

I believe I get the error No app specified. Run this command from an app folder or specify which app to use with --app when I run any ambiguous heroku commands. Example:

heroku logs

It's ambiguous because I have multiple remote repositories specified in my project's .git/config file. The solution for me is simply to specify the remote repository. Example:

heroku logs --remote staging

In the above line --remote staging corresponds to the following in my project's .git/config file:

[remote "staging"]
    url = git@heroku.accountname:foo-bar-1234.git
    fetch = +refs/heads/*:refs/remotes/staging/*

I hope this helps you.. if not, then perhaps it may help someone else!

user664833
  • 18,397
  • 19
  • 91
  • 140
2

When I had this issue it was because I created more than one remote app on heroku.

To remove an existing remote app from heroku use:

git remote rm heroku

then go back and use heroku create to start the process over using the correct app name heroku gives you.

Solution found here: solution

Matt Jensen
  • 1,495
  • 17
  • 21