ruby-on-rails - 在 Heroku 上升级 Bundler 版本

标签 ruby-on-rails heroku rubygems

我的 heroku 应用程序 (cedar 14) 需要一个更新版本的 bundler ,我还没有看到我不能这样做的任何原因。我被困在 1.6.6 上,已经有几个月了,我需要最新的版本。

我需要为我的一个 gem 指定一个 source: 选项,而旧版本的 bundler 不允许这样做。此外,运行 heroku run gem update bundler 成功更新但“heroku run bundle -v”产生 1.6.6。

为什么?

最佳答案

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

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.

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

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: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.

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

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

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

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.

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


除此之外不能直接配置:

Why can’t the Bundler version be configured?

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.

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

关于ruby-on-rails - 在 Heroku 上升级 Bundler 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27115171/

相关文章:

ruby-on-rails - 格式为电子邮件地址链接,ruby on rails

ruby-on-rails - Heroku:使用 Selenium 时无法找到 chromedriver

javascript - Heroku 的配置操作电缆 - 错误 localhost :3000/cable

ruby - 在 m1 mac 上安装 Hermes 引擎时出现 pod 安装问题

ruby-on-rails - 时间可用性比较,使用 Ruby on Rails

ruby-on-rails - 如何避免在 redirect_to :back? 处出现循环

ruby-on-rails - Gitorious Git-daemon Ruby Gem 错误

ruby-on-rails - rake 任务中使用错误的 ruby​​ 路径作为 cron 执行,无论何时

ruby-on-rails - 使用 Brew 安装 rbenv

javascript - 如何运行/执行部署在heroku上的应用程序