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

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

$ git push staging 

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. 

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

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

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

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

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

谢谢!

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

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

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

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

 git remote add heroku https://git.heroku.com/.git 

你也可以输入

 heroku git:remote -a AppName 

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

你也可以运行:

 heroku run rake test --remote staging 

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