Heroku and bundler version - ruby-on-rails

I'm pushing code on Heroku as usual.
But this message appear :
Warning: the running version of Bundler (1.15.2) is older than the
version that created the lockfile (1.16.1). We suggest you upgrade to
the latest version of Bundler by running gem install bundler.
So I run:
heroku run gem install bundler
Running gem install bundler on ⬢ myapp... up, run.3401
(Standard-1X)
Fetching: bundler-1.16.1.gem (100%)
Successfully installed bundler-1.16.1
Parsing documentation for bundler-1.16.1
Installing ri documentation for bundler-1.16.1
Done installing documentation for bundler after 11 seconds
1 gem installed
But when I retry to push code:
heroku run bundle install
Running bundle install on ⬢ myapp... up, run.9532 (Standard-1X)
Warning: the running version of Bundler (1.15.2) is older than the
version that created the lockfile (1.16.1). We suggest you upgrade to
the latest version of Bundler by running gem install bundler.
In the gem Gemfile.lock I got:
BUNDLED WITH
1.16.1
I don't understand why this bundler release doesn't want to be install on Heroku.

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.

You also want to make sure you're using a standard Heroku buildpack for this.
When I attempted to upgrade my app from Cedar to Heroku-20, it kept failing with this same bundler error. But, eventually, I remembered that I had install a custom buildback and that turned out to be the source of the incorrect bundler version.
Once I switched back to the default Heroku Ruby buildpack, I was finally able to deploy without any issues.

Related

Rails on Azure app service: "Could not find 'bundler' (2.1.4)"

I'm trying to deploy my Ruby 2.6.2 with Rails 6.0.3.4 and I'm getting GemNotFoundException with Bundler:
Running bundle check
`find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /home/site/wwwroot>/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`
Running 'gem list bundler' on my local machine returns, I remove the defualt version.
bundler (2.1.4)
I've tried updating gem and it's 3.1.4.
I'm pretty sure I'm correctly pushing it to Azure, as I made a new app service and pushed my Rails app with bundler 2.1.4 and I've tried restarting the VM.
Quite new to Azure, so am pretty stuck on this.

Bundler on Heroku won't run correct version

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

Install local gems via bundle on heroku not working

I'm trying to install my app to heroku. But I'm having an issue with a gem. Its a private gem and we don't have a private gem server setup, so I've cloned the gem locally as a submodule inside the app.
When I push to heroku I get this error:
! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
Detected buildpacks: Ruby,Node.js
See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.5.1
-----> Installing dependencies using bundler 1.15.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
The gemspecs for path gems changed
Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
The gemspecs for path gems changed
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app.
! Push failed
When I removed the locally install gem it all worked fine.
So strong hunch is that bundler 1.15.2 handles local gems differently and it's causing a conflict.
In my Gemfile, not inside any group, I have gem 'portkey', path: './gems/portkey/'
At the top of my Gemfile.lock I have
PATH
remote: gems/portkey
specs:
portkey (0.1.10)
bitly
omniauth-google-oauth2 (~> 0.5.3)
rails (~> 5.2.1)
rebrandly
shortener (~> 0.8.0)
will_paginate
Heroku doesn't support bundler 1.16.2 yet afaik
I'm using rails 5/ruby-2.5 and I don't seem be able to downgrade bundler to 1.15.2 and generate an older version of the lockfile
I can't easily make this gem accessible any other way.
I'm stumped how I can make the install of this gem work, and suggestions would be greatly appreciated.
Had a similar issue, solved by upgrading to Bundler 2.0.1 (which is now supported by Heroku).
For 1.x version they still use 1.15.2 though.

What does "Your bundle is locked to addressable " mean?

I'm trying to bundle exec jekyll serve
but I get this error:
Your bundle is locked to addressable (2.5.0), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of addressable (2.5.0) has removed it. You'll need to update your bundle to a different version of addressable (2.5.0) that hasn't been removed in order to install.
Run `bundle install` to install missing gems.
bundle install gives me
Warning: the running version of Bundler (1.13.6) is older than the version that created the lockfile (1.13.7). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
This works, but it gives me the wrong version I think:
Successfully installed bundler-1.15.1
Parsing documentation for bundler-1.15.1
Done installing documentation for bundler after 4 seconds
1 gem installed
Where is the bundle locked to adressable and what does this mean? I checked my gemfile, it's nothing in there. Can I unlock it? I'm trying to run a boilerplate for jekyll and installed ruby using brew.
The "Your bundle is locked to addressable..." error just means that you have a version of addressable specified in your Gemfile.lock, but it's not installed on your machine (yet). Running bundle install fixes that.
As such, if you run the following, your app should run just fine:
$ bundle install
$ bundle exec jekyll serve
The "Bundler (1.13.6) is older..." warning is just an FYI from the good people at Bundler, encouraging you to upgrade. You can safely ignore it without it affecting your app (but it's good practice to stay up-to-date).

Bundler using old version

I am using Bundler for my Rails application. When I list installed bundler gems it lists 1.4.0.pre.1 and 1.3.15 and running bundler -v yields 1.4.0.pre.1 (which is what i want).
However, when I try to run my application it says current bundler version is 1.0.15. This version is not installed as a gem and I cannot figure out how to remove it (gem uninstall bundler -v 1.0.15 wont work since this version is not installed as a gem).
I have tried updating and installing new versions, but nothing is working. Please help, I've been stuck for hours. Thank you.
Try running:
$ which -a bundle
This will tell you the location of all the instances of bundler found on your computer.
From there, you should be able to locate the offending version of bundler and uninstall it.
This worked for me when using vagrant
[vagrant#precise32:/vagrant (master)]$ sudo gem install bundler
Fetching: bundler-1.11.2.gem (100%)
Successfully installed bundler-1.11.2
1 gem installed
try running this on you app console:
bundle update

Resources