I've just created a simple Rails app using
rails new myapp
then created the heroku stack using:
heroku create --stack cedar
But when I try opening the app on Heroku using:
heroku open
I get:
! No app specified.
! Run this command from an app folder or specify which app to use with --app <app name>
And this:
$ heroku open --app myapp
gives me this:
! App not found
Am I missing something obvious?
If you have an existing app on Heroku and you are getting this no app specified message, you can correct it by running this on your local terminal:
heroku git:remote -a MyHerokuAppName
I had the same issue, All I had to do was cd to project dir instead of running commands from model folder in the project dir.
Another approach to solving the issue is to take a broad understanding of what the .git/config file associated with the heroku app is doing and make the necessary tweaks.
1.Open
.git/config
from your heroku project's root.Your git config file may look something like this, especially if you are juggling a couple heroku accounts on your machine.
git@heroku.{heroku.account}
shows up instead ofgit@heroku.com
because of the configuration in your~/.ssh/config
file. The reference toheroku-app-8396.git
should be updated to match your heroku project name. Each heroku account you have should have an entry in the~/.ssh/config
file. Obviously, the heroku account that this heroku project is associated with should show up in your.git/config
file.2.When I run
git pull heroku master
, all seems to run well.3.When I run
heroku logs
, I get an error message:Why?
As far as I can tell, the
heroku
command doesn't seem to know what to do with the{heroku.account}
references. If we change those references tocom
(which is the default value when you are not using the 'accounts' heroku plugin), theheroku
commands work once again, but now ourgit
calls are saying there is a different problem:One way to resolve this is to define a remote for
git
and a remote forheroku
and then tellheroku
which remote to use.I like to explicitly specify the remote when I'm pushing content to a remote, so the
heroku
remote is for that, even though this configuration also accommodates pushing/pulling using the default (e.g.,git push
). I create a new remote 'heroku-app' and addremote = heroku-app
to tellheroku
to use a remote that doesn't include the heroku account in the URI.Now I can run my
git
andheroku
commands as I want to.Heroku by default is not creating app with your directory name, so when you do
it is creating application named 'calm-bayou-3229' And you can do
You can always list your apps with:
If you have the app's git repo copy on you local machine then
cd
to that location and that's it!!You will be able to use the app. You can verify this by commands like:
heroku logs -n 1500