在Heroku上升级Bundler版本 [英] Upgrading Bundler Version on Heroku

查看:97
本文介绍了在Heroku上升级Bundler版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在heroku应用程序(雪松14)上需要捆绑器的更新版本,但我还没有找到为什么我不能这样做的任何原因.我停留在两个月前的1.6.6上,我需要最新的版本.

I need an updated version of bundler on my heroku application (cedar 14) and I haven't seen any reason why I can't do this. I'm stuck at 1.6.6 which is a couple months old and I need the most up to date version.

我需要为我的一颗宝石指定source:选项,而较早版本的捆绑器不允许这样做.此外,运行heroku run gem update bundler成功更新,但是'heroku run bundle -v'产生1.6.6.

I need to specify a source: option for one of my gems and the older version of bundler doesn't allow this. Additionally, running heroku run gem update bundler successfully updates but 'heroku run bundle -v' yields 1.6.6.

为什么?

推荐答案

您可以通过在Heroku上指定Ruby Buildpack来修改使用的捆绑程序版本:

You can modify the bundler version used by specifying the Ruby Buildpack on Heroku:

如果您发现自己正在使用其他版本的Bundler Ruby Support文章中列出的应用程序,您的 应用程序可能配置为使用Ruby的master分支 用于部署的buildpack.

If you see that a different version of Bundler is being used by your application than is listed in the Ruby Support article, your application might be configured to use the master branch of the Ruby buildpack for deployments.

要检查配置了哪个buildpack,请使用heroku buildpacks 命令:

To check which buildpack is configured, use the heroku buildpacks command:

>  heroku buildpacks
> === hidden-temple-25627 Buildpack URL https://github.com/heroku/heroku-buildpack-ruby.git

示例输出显示未发布的buildpack版本 正在被使用.要切换到受支持的版本,请设置buildpack 如下:

The example output shows that an unreleased version of the buildpack is being used. To switch to the supported version, set the buildpack as follows:

heroku buildpacks:设置heroku/ruby​​ Buildpack集.下一版本 hidden-temple-25627将使用heroku/ruby​​.运行git push heroku master 使用此buildpack创建新版本.

heroku buildpacks:set heroku/ruby Buildpack set. Next release on hidden-temple-25627 will use heroku/ruby. Run git push heroku master to create a new release using this buildpack.

您可以通过键入以下内容来验证是否已设置新的buildpack:

You can verify that the new buildpack has been set by typing:

>  heroku buildpacks
> === hidden-temple-25627 Buildpack URL heroku/ruby

您的应用可能未使用当前支持的另一个原因 Bundler版本是如果配置为使用其他版本进行部署 buildpack URL.如果BUILDPACK_URL config var为 设置.

Another reason your app might not be using the currently supported Bundler version is if it is configured to deploy using a different buildpack URL. This will happen if the BUILDPACK_URL config var is set.

>  heroku config:get BUILDPACK_URL BUILDPACK_URL:                     
> https://github.com/heroku/heroku-buildpack-ruby.git

如果看到任何值,则说明您使用的是自定义buildpack.如果这 值设置为"multi buildpack",例如 https://github.com/heroku/heroku-buildpack-multi 然后,您将需要 检查.buildpacks文件以查看在其中使用了哪些buildpacks 部署.如果您使用这种部署方法,我们建议 而是您遵循了使用多个构建包"中的指导 以获得应用文章.

If you see any value, then you are using a custom buildpack. If this value is set to a "multi buildpack" such as https://github.com/heroku/heroku-buildpack-multi then you will need to check the .buildpacks file to see what buildpacks are used in deployment. If you are using this method of deployment we recommend that you instead follow the guidance in the Using Multiple Buildpacks for an App article.

正式部署的Ruby buildpack有时会落后 掌握几天.

The officially deployed Ruby buildpack will sometimes lag behind master for a few days.


除此之外,它不能直接配置:


Other than that it can not be directly configured:

为什么不能配置Bundler版本?

Bundler的不同版本存在不同的已知错误,并且略有不同 不同的行为. Heroku上的Bundler版本是精心设计的 策划.在支持新的Bundler之间需要取得平衡 功能和稳定性.我们为策划Bundler所做的工作 版本可确保最大的稳定性,并避免过时和 Bundler发生更改或错误修复时的通知周期 安全问题已由Heroku修补.

Different versions of Bundler have different known bugs and slightly different behavior. The Bundler version on Heroku is carefully curated. A balance needs to be struck between supporting new Bundler features and stability. The work we put into curating the Bundler version ensures maximum stability, and avoids deprecation and notification cycles on Bundler as it changes, or as bugs are fixed or security issues are patched by Heroku.

Heroku上的Ruby体验由Heroku Ruby提供 Buildpack.这是安装Bundler版本的工具, 运行安装应用程序所需的所有命令.这 buildpack依赖于公开发布的Bundler内部.它是 经过测试并已知可与当前指定的版本一起使用 捆绑器.如果您要使用现代的buildpack并将其与 较旧版本的捆绑器,您可能会看到无法预测的情况 结果.

The Ruby experience on Heroku is provided by the Heroku Ruby Buildpack. This is the tool that installs a version of Bundler and runs all the commands needed to get your application set up. The buildpack relies on publicly exposed internals of Bundler. It is tested and known to work against the currently specified version of Bundler. If you were to take a modern buildpack and use it with an older version of bundler, you would be likely to see unpredictable results.

https://devcenter.heroku.com/articles/bundler-version

这篇关于在Heroku上升级Bundler版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆