I am trying to run bash on heroku to test it out and it is failing
$ heroku run bash
▸ Error: No app specified
▸ Usage: heroku run --app APP
▸ We don't know which app to run this on.
▸ Run this command from inside an app folder or specify which app to use with --app APP
▸
▸ https://devcenter.heroku.com/articles/using-the-cli#app-commands
$ heroku run --app bash
▸ Usage: heroku run COMMAND
▸
▸ Example: heroku run bash
So, the example says heroku run bash will work but it doesn't. I have no dynos running. I feel I am missing something basic here...
Try run commands:
First you need to login, then you to see your apps and finally run bash
heroku login
Insert you user and password
heroku apps
=== user#gmail.com Apps
myaplication
then look at the list apps and write
heroku run bash --app myaplication
You could also do this:
get app name using;
heroku apps
then set heroku remote;
heroku git:remote -a yourappname
and finally run bash on/in your app
heroku run bash
I think you have two issues.
Firstly, you need to run bash within some app. You can either specify the app via the --app key as the help actually says or you can run this command inside the folder which has a heroku app initialized already. For connecting the folder to a heroku app - see this answer How to link a folder with an existing Heroku app.
Second, running a bash actually takes away one dyno from your app. So you need to have at least one dyno.
Try this command:
heroku pg:psql -a appname
Related
I am trying to schedule PostgreSql procedure using Heroku scheduler. I tried heroku pg:psql -c "call procedure_name();" --app app-name but gets the error from scheduler "bash: heroku: command not found"
That error is telling you important information. The Heroku CLI is not present in your environment, so bash complains that heroku isn't a command that it recognizes.
If you want to run heroku commands from your application you'll need to include the cli buildpack when you build your application to make sure it's properly bundled. Once you've included the buildpack and triggered a new build, this should work.
I used to run heroku create and deploying with git push heroku master but I've since moved onto a Github based workflow where code is first pushed to my Github repo, and deployed via a web hook.
I now have to run --app appname or -a appname after every command, and it gets annoying.
e.g.
heroku run rails db:migrate -a appname # instead of
heroku run rails db:migrate
heroku run rails console -a appname # instead of
heroku run rails console
heroku run logs -t -a appname # instead of
heroku run logs -t
How do I force heroku-toolbelt to link this repo to the heroku app so that I can run heroku without the --app parameter
Add a remote named heroku with the url https://git.heroku.com/appname.git
Run this:
$ git remote add heroku https://git.heroku.com/appname.git
I deployed an app onto heroku and wanted to check how can I connect to the deployed app in my terminal so I can do things like run migrations?
thanks in advance!
You can use the heroku command to create a one-off dyno to run arbitrary commands like bash or rake db:migrate.
For example heroku run bash -a my-app will run a bash shell on a one-off dyno.
Note that there is no way to directly connect to a running dyno on Heroku (e.g. via ssh); running the heroku run command will create a new temporary dyno that you can use to run commands using the deployed version of the code.
Why is heroku run bash not working?
$ heroku login
Enter your Heroku credentials.
Email: xx#yy.zz
Password (typing will be hidden):
Logged in as xx#yy.zz
$ heroku run bash
▸ No app specified.
▸ Run this command from an app folder or specify which app to use with --app APP
$ heroku run --app bash
▸ Usage: heroku run COMMAND
▸
▸ Example: heroku run bash
$ heroku run "ls /usr/bin/"
▸ No app specified.
▸ Run this command from an app folder or specify which app to use with --app APP
$ heroku run --app "ls /usr/bin/"
▸ Usage: heroku run COMMAND
▸
▸ Example: heroku run bash
$ heroku version
heroku-toolbelt/3.42.22 (universal.x86_64-darwin15) ruby/2.0.0
heroku-cli/4.27.11-7569c5d (amd64-darwin) go1.5.2
=== Installed Plugins
heroku-apps#1.1.0
heroku-cli-addons#0.1.1
heroku-fork#4.0.0
heroku-git#2.4.4
heroku-local#4.1.5
heroku-run#2.9.2
heroku-spaces#2.0.9
heroku-status#1.2.4
As the error message indicates, you need to specify which heroku app you want to run commands on. (If you're in a git repository with a remote pointing to heroku, it will use that one by default; that's what it means by "from an app folder".)
$ heroku apps
will give you a list.
$ heroku run --app INSERT_APP_NAME_HERE bash
will run bash on that app.
This error is because of not specifying the app you want to use. Try this
$heroku app
example
$heroku run bash --app examp
need to manually specify the name of the image with the run
command like:
heroku run bash --type worker -a app_name
When I use the command heroku addons create:graphenedb --version v195. It gives error "No app specified , Run this command from an app folder or specify which app to use." I am new to Heroku and I do not understand which app folder it is talking about.
If you're not in your project folder or if it doesn't have a git remote to point it to Heroku you need to use the --app flag for the heroku command to specify the name of your app on Heroku