How to Solve the Update Bundler Warning in Rails When Deploying to Heroku

How to solve the update bundler warning in rails when deploying to OpenShift?

Typically, running an out-of-date bundler will not cause any issues, so you should be able to safely ignore the Warning.

However, if you must update the version of bundler for some reason, you should use an .s2i/bin/assemble script to update the version of bundler prior to the default build process. So something similar to

#!/bin/bash -e
# The assemble script builds the application artifacts from source and
# places them into appropriate directories inside the image.

echo "---> Updating bundler gem..."
gem install bundler

# Execute the default S2I script
source ${STI_SCRIPTS_PATH}/assemble

should do the trick. If you add this to your repository in the .s2i/bin directory as an executable assemble script (definition don't forget to chmod +x assemble before adding this to your repository), this should take care of the issue for you.

You can also see the default Ruby 2.5 assemble script in the sclorg GitHub repo: https://github.com/sclorg/s2i-ruby-container/blob/master/2.5/s2i/bin/assemble. Just change the version in the URL as needed in case your curious.

How do I fix a Bundler Conflict when pushing to Heroku?

I've ran into this issue some time ago: I contacted Heroku and they told me they have a locked version of Bundler, so your only option is to use the Bundler version they use:

gem uninstall bundler
gem install bundler -v 2.0.2
bundle update

Heroku and bundler version

Bundler 1.15.2 is the version that is pre-installed on Heroku dynos. Changing Bundler to 1.16.1 on your machine doesn't change the version installed on Heroku.

Furthermore, you cannot update Bundler on Heroku by running bundle install. And even if that was possible it would take effect on the next run of Bundler - and usually, you only bundle once on a Heroku dyno.

My advice is: It is just a warning, just ignore it and let's hope that Heroku updates Bundler more ofter in the future.



Related Topics



Leave a reply



Submit