尝试设置 Heroku 暂存站点 - “找不到资源”
我正在开发一个部署在 Heroku 上的现有 Rails 项目。我正在尝试设置一个从临时分支部署的临时服务器。 (目前 master 已部署到生产环境)。
我正在关注这个页面
我正在“从生产应用程序开始”部分。它给出的代码是
heroku create --stack [生产堆栈] --remote staging --addons newrelic:bronze,logging:expanded
我正在尝试根据自己的需要调整它,但我得到了返回消息未找到资源
。
这是我得到的“heroku apps”
custom_domains:basic
exceptional:basic
logging:expanded
shared-database:5mb
如果我执行heroku list
,我会得到这个
buddystef <project manager's email>
vivid-window-286
vivid-earth-537
,其中“buddystef”是应用程序的生产版本。所以,我正在尝试这个:
heroku create --stack [buddystef stack] --remote buddy-staging --addons custom_domains:basic,exceptional:basic,logging:expanded,shared-database:5mb
我收到找不到资源
我需要先为暂存分支设置一个单独的 git 存储库吗?如果是这样,最好的方法是什么?
感谢任何建议 - 最大
编辑 - “找不到资源”消息似乎(在谷歌搜索后)与使用错误的凭据登录相关。但是,我是以 buddystef 项目所有者的身份登录的。
I'm working on an existing rails project which is deployed on heroku. I'm trying to set up a staging server which deploys from the staging branch. (currently master deploys to production).
I'm following this page
http://devcenter.heroku.com/articles/multiple-environments#starting_with_a_production_app
and i'm on the section "Starting from a production app". The code it gives is
heroku create --stack [production stack] --remote staging --addons newrelic:bronze,logging:expanded
I'm trying to adapt this to my own needs but i get a message back Resource not found
.
Here's what i get for "heroku apps"
custom_domains:basic
exceptional:basic
logging:expanded
shared-database:5mb
If i do heroku list
i get this
buddystef <project manager's email>
vivid-window-286
vivid-earth-537
where 'buddystef' is the production version of the app. So, i'm trying this:
heroku create --stack [buddystef stack] --remote buddy-staging --addons custom_domains:basic,exceptional:basic,logging:expanded,shared-database:5mb
And i'm getting Resource not found
Do i need to set up a seperate git repo first for the staging branch? If so, what's the best way to do this?
Grateful for any advice - max
EDIT - the "Resource not found" message seems (after googling) to be associated with logging in with the wrong credentials. But, i'm logging in as the owner of the buddystef project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看来你的事情过于复杂了,麦克斯。保持简单,按照 John 建议创建应用程序,添加插件,然后将其声明为暂存环境:
创建与
development.rb
类似的environments/staging.rb
如果它是公共站点,您可能希望防止公共访问,避免让用户感到困惑。请参阅此密码保护登台环境的答案
Git:你应该有自己的暂存分支。请记住,heroku 在 master 分支上运行,因此您应该执行以下操作:
在此处阅读有关 git 良好实践的更多信息:http://nvie.com/posts/a-successful-git-branching-model/
Seems like your over-complicating things here, Max. Keep it simple, create the app like John suggests, add the addons, then declare it a staging environment:
create the
environments/staging.rb
similar to that ofproduction.rb
If it's a public site, you'd probably wish to secure it from public access, avoid confusing users. See this SO answer for password protecting staging environment
Git : You should have your own staging branch. Remember that heroku operates on master branch, so you should do this:
Read more about git good practices here: http://nvie.com/posts/a-successful-git-branching-model/
Heroku create with stack synxtax 是
bamboo-mri-1.9.2 可以是以下任何一个:
所以我不确定你的位置
[buddystef stack]
来自但这可能就是问题所在Heroku create with stack synxtax is
where bamboo-mri-1.9.2 can be any of the following:
so I'm no sure where your
[buddystef stack]
comes from but that's likely the problem我使用 Heroku San,它可以为您完成一些跑腿工作。 Github | 教程
I use Heroku San, which does some of the legwork for you. Github | Tutorial