在 heroku 上运行 bash 不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35857787/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 14:20:52  来源:igfitidea点击:

Running bash on heroku won't work

bashheroku

提问by E.S.

I am trying to run bash on heroku to test it out and it is failing

我正在尝试在 heroku 上运行 bash 来测试它,但它失败了

 $ 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
 $ 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 bashwill work but it doesn't. I have no dynos running. I feel I am missing something basic here...

所以,这个例子说heroku run bash会起作用,但它不会。我没有运行 dynos。我觉得我在这里缺少一些基本的东西......

回答by Omar Duarte

Try run commands:

尝试运行命令:

First you need to login, then you to see your apps and finally run bash

首先你需要登录,然后你才能看到你的应用程序,最后运行 bash

$heroku login

Insert you user and password

输入您的用户名和密码

$heroku apps
=== [email protected] Apps
myaplication

then look at the list aps and write

然后查看列表aps并写

$heroku run bash --app myaplication 

回答by omdv

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.

首先,您需要在某个应用程序中运行 bash。您可以通过 --app 键指定应用程序,如帮助实际所述,或者您可以在已初始化 heroku 应用程序的文件夹中运行此命令。要将文件夹连接到 heroku 应用程序 - 请参阅此答案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.

其次,运行 bash 实际上会从您的应用程序中删除一个 dyno。所以你至少需要一个dyno。

回答by gaurav malik

Try this command:

试试这个命令:

heroku pg:psql -a appname