Reputation: 2227
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.
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.
Why?
Upvotes: 3
Views: 1144
Reputation: 4404
You can modify the bundler version used by specifying the Ruby Buildpack on Heroku:
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.
Other than that it can not be directly configured:
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
Upvotes: 1