简体   繁体   English

如何在Heroku中指定机架版本?

[英]How can I specify a Rack version on Heroku?

I'm experiencing an error with a Rails application as described in https://github.com/rack/rack/issues/386 . https://github.com/rack/rack/issues/386中所述,Rails应用程序出现错误。 The fix is to use the latest version of Rack available on Rack's master branch. 解决方法是使用Rack的master分支上可用的最新版本的Rack。 I can modify my Gemfile to use the master branch locally, but it seems like Heroku is ignoring it and continues using the gem from RubyGems. 我可以修改我的Gemfile以在本地使用master分支,但是Heroku似乎忽略了它,并继续使用RubyGems中的gem。

Here is the line in the GemFile. 这是GemFile中的行。

gem 'rack', :git => 'git://github.com/rack/rack'

Is it possible to force Heroku to use the master branch or Rack? 是否可以强制Heroku使用master分支或Rack?

It turns out gem 'rack', :git => 'git://github.com/rack/rack' does in fact work. 事实证明gem 'rack', :git => 'git://github.com/rack/rack'实际上有效。 My problem was I was pushing to heroku from a branch that was not the master, and heroku will only use the master branch of your repository unless you specify otherwise. 我的问题是我从不是主服务器的分支推送到heroku,除非您另外指定,否则heroku将仅使用存储库的master分支。

The correct way to push in such a situation is 解决这种情况的正确方法是

git push heroku mybranch:master

That was a difficult way to learn the correct method for pushing branches to heroku. 这是学习将分支推送到heroku的正确方法的困难方法。 I'm sure I'll never forget it now. 我相信我永远不会忘记它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM