I am working in aws c9 and I am trying to send my app to heroku but it keeps telling me I am running the wrong version of bundler, so I run gem install bundler
locally and I get 2.0.1, but on Heroku it keeps running 1.17.1 and I can't change this version.

- 1,592
- 14
- 19

- 1
- 1
-
Welcome to Stack Overflow. I don't think there is anything we can do to help you with this. That error appears pretty fatal to me. – Mikkel Jan 07 '19 at 20:15
-
Well there has to be some way to fix as I have restarted my app from the beginning several times now attempting to make it work.... – Donald Lundgren Jan 07 '19 at 21:59
1 Answers
Heroku pin the bundler version for reasons of their own:
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.
https://devcenter.heroku.com/articles/bundler-version
They're still on 1.17.1 at time of writing, but that shouldn't generally be a problem.
EDIT
This might be a problem because your local version of bundler is later than that. This is especially the case if you're running bundler 2+ locally, because that creates a Gemfile.lock
which won't allow older versions to install from it.
If that's the case then you need to downgrade your local version and rebundle:
local> gem uninstall bundler
local> gem install bundler -v 1.17.1 (or whatever version)
local> rm Gemfile.lock
local> bundle install

- 1,592
- 14
- 19
-
-
remote: -----> Ruby app detected remote: remote: ! remote: ! You must use Bundler 2 or greater with this lockfile. remote: ! – Donald Lundgren Jan 07 '19 at 21:57
-
-
@DonaldLundgren OK, if that's the case then you'll need to downgrade your local version of bundler. It puts the version into the `Gemfile.lock`, and apparently bundler 2+ creates lockfiles that can't run with old versions. Locally, do something like: `gem uninstall bundler ; gem install bundler -v 1.17.1 ; bundle update`. If `bundle update` fails then just delete your Gemfile.lock and type `bundle install` again. – Dave Slutzkin Jan 07 '19 at 22:09
-
ok that worked but now it wont precompile assets..Precompiling assets failed. – Donald Lundgren Jan 07 '19 at 23:16
-
-