尝试访问heroku控制台时,“您无法访问该应用程序”

时间:2021-11-21 23:54:15

I recently started collaborating in a project on Heroku using Ruby on Rails. I was added as a collaborator and added the remote to my environment. After some development, I pushed some changes and had no problems:

我最近开始使用Ruby on Rails在Heroku上的一个项目中进行合作。我被添加为协作者并将远程添加到我的环境中。经过一些开发,我推动了一些改变并没有遇到任何问题:

$ git push staging

Where staging is the name of my remote. Later, when trying to run "rake test" on Heroku, I recieved an error:

staging是我的遥控器的名称。后来,当试图在Heroku上运行“rake test”时,我收到了一个错误:

$heroku run rake test --app staging
Running `rake test` attached to terminal... failed
 !    You do not have access to the app staging.

Which is odd, as I was perfectly able to push my own changes. I checked the Heroku dashboard and saw that my push was logged there. I then tried to view the logs using the console, and the same problem occured.

这很奇怪,因为我完全能够推动自己的变化。我检查了Heroku仪表板,看到我的推送记录在那里。然后我尝试使用控制台查看日志,并出现同样的问题。

$ heroku logs --app staging
 !    You do not have access to the app staging.

Finally, I tried to access the console, but it failed as well.

最后,我试图访问控制台,但它也失败了。

$ heroku run rails console --app staging
Running `rails console` attached to terminal... failed
 !    You do not have access to the app staging.

At this point I updated my Heroku toolbelt installation, and used "heroku auth" to verify that my email was showing up, but the error persists. I'm currently contacting Heroku support but I'm hoping someone with a similar issue could aid me in parallel.

此时我更新了我的Heroku toolbelt安装,并使用“heroku auth”来验证我的电子邮件是否显示,但错误仍然存​​在。我目前正在联系Heroku支持,但我希望有类似问题的人可以帮助我并行。

Thanks!

谢谢!

5 个解决方案

#1


30  

So just in case anyone is having a similar problem, this occurs because I was mixing the name of my Heroku Apps with the name of my git remotes. So when I was calling --app staging (the name of my remote), I should have been using the actual name of the app, as found in Heroku.

因此,万一有人遇到类似的问题,这是因为我将我的Heroku应用程序的名称与我的git遥控器的名称混合在一起。因此,当我调用--app staging(我的遥控器的名称)时,我应该使用应用程序的实际名称,如Heroku中所示。

#2


5  

This happen also when you haven't added heroku git remote repository.

当您还没有添加heroku git远程存储库时,也会发生这种情况。

You can add it with this command:

您可以使用以下命令添加它:

git remote add heroku https://git.heroku.com/<your project>.git

You can also type

你也可以输入

heroku git:remote -a AppName

#3


5  

Be sure to run heroku login before using Heroku toolbelt commands for the first time. It will not tell you that you have not signed in before.

在第一次使用Heroku toolbelt命令之前,请务必运行heroku登录。它不会告诉您之前没有登录过。

#4


0  

This was caused of your ssh key is no more permited to access. Make sure your ssh key is same. You can also regenarate your ssh key and add this to heroku.

这是因为您的ssh密钥不再被授权访问。确保您的ssh密钥相同。您还可以重新生成您的ssh密钥并将其添加到heroku。

#5


0  

You can also run:

你也可以运行:

heroku run rake test --remote staging

Not sure what happens under the hood, but locally the CLI tool figures out which app you mean based on your git remote.

不知道底层会发生什么,但本地CLI工具会根据你的git遥控器找出你的意思。

#1


30  

So just in case anyone is having a similar problem, this occurs because I was mixing the name of my Heroku Apps with the name of my git remotes. So when I was calling --app staging (the name of my remote), I should have been using the actual name of the app, as found in Heroku.

因此,万一有人遇到类似的问题,这是因为我将我的Heroku应用程序的名称与我的git遥控器的名称混合在一起。因此,当我调用--app staging(我的遥控器的名称)时,我应该使用应用程序的实际名称,如Heroku中所示。

#2


5  

This happen also when you haven't added heroku git remote repository.

当您还没有添加heroku git远程存储库时,也会发生这种情况。

You can add it with this command:

您可以使用以下命令添加它:

git remote add heroku https://git.heroku.com/<your project>.git

You can also type

你也可以输入

heroku git:remote -a AppName

#3


5  

Be sure to run heroku login before using Heroku toolbelt commands for the first time. It will not tell you that you have not signed in before.

在第一次使用Heroku toolbelt命令之前,请务必运行heroku登录。它不会告诉您之前没有登录过。

#4


0  

This was caused of your ssh key is no more permited to access. Make sure your ssh key is same. You can also regenarate your ssh key and add this to heroku.

这是因为您的ssh密钥不再被授权访问。确保您的ssh密钥相同。您还可以重新生成您的ssh密钥并将其添加到heroku。

#5


0  

You can also run:

你也可以运行:

heroku run rake test --remote staging

Not sure what happens under the hood, but locally the CLI tool figures out which app you mean based on your git remote.

不知道底层会发生什么,但本地CLI工具会根据你的git遥控器找出你的意思。