I did a
gem update
The bundler gem got updated from 2.1.4 from 2.1.2 (which was installed with ruby 2.7.0). I did a
bundle update --all
on my project after removing the Gemfile.lock. Everything proceeded normally. I started getting warnings that look like this when I run the executable in that project:
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile
(2.1.4). We suggest you to upgrade to the version that created the lockfile by running 'gem install
bundler:2.1.4'.
After doing the above again, I noticed the following in the list of gems installed into the bundle:
...
Using opener 0.1.0
Using binman 5.1.0
Using bundler 2.1.2 <<< ?!?
Using color 1.8
Using parslet 1.8.2
...
I uninstalled bundler-2.1.4 and re-build the project bundle and everything is back to normal.
I've done this a million times... What did I miss this time?
Can you provide the detail of reproducible instructions with only the command-line?
Here you go... This happened to be on macOS Catalina (10.15.2) but I get the exact same results in the same way on Debian 10 (64-bit AMD & 32-bit ARM7l).
+1
just run your app trough bundler
bundle exec bin/rails s
There's detailed description of the problem but it's not a bundler problem actually
https://qiita.com/scivola/items/8176304c03a92aebdfe2
You write:
just run your app trough bundler
bundle exec bin/rails s
Uh...no... Why should I have to do that when I've NEVER EVER had to do that before. Besides, part of it runs as part of the email delivery pipeline so not entirely possible. Better to stick with bundler-2.1.2... This problem affects many apps...not just the one I used as an illustration.
You write:
There's detailed description of the problem but it's not a bundler problem actually
https://qiita.com/scivola/items/8176304c03a92aebdfe2
I don't read Japanese at all... Can some kind soul post the executive summary?
I don't read Japanese at all...
So, do I ) But nowadays we have a magic Google Translate tool erasing linguistic borders
I've degraded by the way server from 2.7.0 to 2.6.5 â got tired of devops tuning overhead for 2.7.0
By the way latest bundler 2.1.4 works fine with pevious ruby 2.6.5
Same problem here installing ruby 2.7.0 thru rbenv.
I thought gem install bundler would update to 2.1.4, but seems it still defaults to 2.1.2:
bundler (2.1.4, default: 2.1.2)
Any updates here?
@StuartPBW It's expected behavior. Not the same problem.
@hsbt Right on. Thanks for the clarification.
Also having the same problem. What is causing this? Even if I use the binstubs I get this error.
Update: after bashing my head against a wall with this, I finally resolved the issue by deleting the binstubs in my Rails bin directory. You can then optionally re-generate them after making sure you are running the latest version of Bundler.
For me I would see this warning in Spring-enabled Rails apps on Ruby 2.7.0.
$ bin/rails console
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
My workaround is to modify bin/spring as follows:
diff --git bin/spring bin/spring
index d89ee49..8bf446f 100755
--- bin/spring
+++ bin/spring
@@ -4,6 +4,7 @@
# It gets overwritten when you run the `spring binstub` command.
unless defined?(Spring)
+ gem 'bundler', '2.1.4' # Match BUNDLED WITH in Gemfile.lock
require 'rubygems'
require 'bundler'
bin/rails now activates the correct version of Bundler and doesn't print a warning.
thanks @mattbrictson - works for me!
also experiencing this problem, in a brand new empty gem project. Also, gem list bundler shows the default version as being 2.1.0.pre2 even though it seems to actually be 2.1.2
$Â gem list bundler
*** LOCAL GEMS ***
bundler (2.1.4, default: 2.1.0.pre.2)
bundler-unload (1.0.2)
guard-bundler (3.0.0)
rubygems-bundler (1.4.5)
$Â Â bundle info bundler
* bundler (2.1.4)
Summary: The best way to manage your application's dependencies
Homepage: https://bundler.io
Path: /Users/lasto/.rvm/gems/ruby-2.7.0/gems/bundler-2.1.4
$Â which bundle
/Users/lasto/.rvm/gems/ruby-2.7.0/bin/bundle
$Â which aruba
/Users/lasto/.rvm/gems/ruby-2.7.0/bin/aruba
$Â aruba
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
Traceback (most recent call last):
6: from /Users/lasto/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:10:in `<main>'
5: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `run'
4: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `each'
3: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:50:in `block in run'
2: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/rubygems-bundler-1.4.5/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
1: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- rubygems-bundler/noexec (LoadError)
17: from /Users/lasto/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:10:in `<main>'
16: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `run'
15: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `each'
14: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:50:in `block in run'
13: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/rubygems-bundler-1.4.5/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
12: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:156:in `require'
11: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:in `rescue in require'
10: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:in `require'
9: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:131:in `<top (required)>'
8: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:124:in `check'
7: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:94:in `setup'
6: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/bundler.rb:149:in `setup'
5: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/bundler/runtime.rb:22:in `setup'
4: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/bundler/shared_helpers.rb:76:in `set_bundle_environment'
3: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/bundler/shared_helpers.rb:297:in `set_bundle_variables'
2: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/bundler/rubygems_integration.rb:223:in `bin_path'
1: from /Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems.rb:252:in `bin_path'
/Users/lasto/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /Users/lasto/clients/metafeat/tooledup/skellie/Gemfile.lock. (Gem::GemNotFoundException)
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`
Making bundler a default gem in rubygems was a mistake.
For me installing th newest version (3.1.2) of RubyGems solved this issue. :+1:
gem update --system
For me installing th newest version (3.1.2) of RubyGems solved this issue. ð
gem update --system
I tried what you suggest in one of my development projects and there were no changes in the result.
For me installing th newest version (3.1.2) of RubyGems solved this issue. +1
gem update --systemI tried what you suggest in one of my development projects and there were no changes in the result.
Mhm. Strange. Okey, then try this flow and let me know results:
rvm reinstall 2.7.0)gem info bundler gem update --systemgem install bundler:2.1.2 separaterelyrm Gemfile.lock && bundleI tried what you suggest in one of my development projects and there were no changes in the result.
Mhm. Strange. Okey, then try this flow and let me know results:
- Re-install Ruby 2.7.0 (I'm using rvm so
rvm reinstall 2.7.0)
I removed ruby 2.7.0 completely and installed from source.
- Make sure you have only one version of bundler which is 2.1.2 -
gem info bundler
The bundler that was installed from source was 2.1.2.
- Update ruby gems to the most recent version
gem update --system
I updated rubygems-update to 3.1.2.
I updated all the gems that needed it. bundler was updated to 2.1.4.
2.1. If you are using rvm then I recommend you to install bundler for in your gemset with
gem install bundler:2.1.2separately
I don't use rvm.
- Re-install your gems with
rm Gemfile.lock && bundle
I removed .bundle, gem cache & Gemfile.lock in my development project. Did bundle update --all.
The snippet from Gemfile.lock is:
BUNDLED WITH
2.1.4
When I run the binary, I get:
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
I removed bundler:2.1.4
I removed .bundle, the gem cache & Gemfile.lock in my development project. Did bundle update --all.
The snippet from Gemfile.lock is:
BUNDLED WITH
2.1.2
The binary runs correctly...no warning message.
I tried what you suggest in one of my development projects and there were no changes in the result.
Mhm. Strange. Okey, then try this flow and let me know results:
- Re-install Ruby 2.7.0 (I'm using rvm so
rvm reinstall 2.7.0)I removed ruby 2.7.0 completely and installed from source.
- Make sure you have only one version of bundler which is 2.1.2 -
gem info bundlerThe bundler that was installed from source was 2.1.2.
- Update ruby gems to the most recent version
gem update --systemI updated
rubygems-updateto 3.1.2.I updated all the gems that needed it.
bundlerwas updated to 2.1.4.2.1. If you are using rvm then I recommend you to install bundler for in your gemset with
gem install bundler:2.1.2separatelyI don't use
rvm.
- Re-install your gems with
rm Gemfile.lock && bundleI removed
.bundle, gem cache &Gemfile.lockin my development project. Didbundle update --all.The snippet from
Gemfile.lockis:BUNDLED WITH 2.1.4When I run the binary, I get:
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.I removed
bundler:2.1.4I removed
.bundle, the gem cache &Gemfile.lockin my development project. Didbundle update --all.The snippet from
Gemfile.lockis:BUNDLED WITH 2.1.2The binary runs correctly...no warning message.
Can you show Gemfile? Maybe you hsve added gem 'bundler' line to Gemfile?
source "https://rubygems.org"
gem "thor"
gem "sqlite3"
gem "dmarc"
gem "mail"
gem "ox"
gem "rubyzip"
gem "ruport"
gem "rubylib", :git => 'ssh://[email protected]:/home/stevewi/etc/archives/git/rubylib.git'
gem "rubydoc", :git => 'ssh://[email protected]:/home/stevewi/etc/archives/git/rubydoc.git'
There are no references to bundler in the Gemfile & *.gemspec files for rubylib & rubydoc either.
I reinstalled bundler:2.1.4 & I removed .bundle, gem cache & Gemfile.lock in 2 other development projects. Did bundle update --all in each. Same warning occurs when I run the binaries in each.
I removed bundler:2.1.4 & repeated with the 2 other development projects and the binaries run correctly.
Mhm. Sorry.
I've tried to reproduce it in clean Docker container with ruby installed from source but it wasn't success.
Everything seems working as expected even when I'm using Ruby installed from source
My scenario is not in a Docker container.
On Sat, Mar 7, 2020 at 1:43 PM JokÅ«bas PuÄinskas notifications@github.com
wrote:
Mhm. Sorry.
I've tried to reproduce it in clean Docker container with ruby installed
from source but it wasn't success.â
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rubygems/bundler/issues/7601?email_source=notifications&email_token=AAR6X5JSY4A4FPCRDYANZVLRGK5WVA5CNFSM4KLNQH52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOEGDKI#issuecomment-596140457,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAR6X5P5EBKVHTDTTRTLKD3RGK5WVANCNFSM4KLNQH5Q
.
I am having the same issue. Any update here?
Same here, bundler 2.1.2 seems pinned in the system, even though a more recent version is installed:
$ gem list bundler
*** LOCAL GEMS ***
bundler (2.1.4, default: 2.1.2)
$ gem update bundler --default
Updating installed gems
Nothing to update
$ gem uninstall bundler:2.1.2
Gem bundler-2.1.2 cannot be uninstalled because it is a default gem
Any clue on how to remove 2.1.2 and leave only 2.1.4? Under ruby 2.7.0 if it matters.
You can remove 2.1.2 with some judicious removal of files (at least so gem list doesn't report it being there)...however, once you do that, and bundle with 2.1.4, your project will crash because there's some part of the ruby 2.7.0 installation that always references 2.1.2.
Just remove 2.1.4 instead. Believe me, you don't need the aggravation...
Hi everyone, can someone provide repro steps so I can take a look? Thanks!
See above... I've provided at least two -- one on 24 Jan and another on 7 Mar.
@deivid-rodriguez this reproduces the error warning for me: https://github.com/martinsp/bundler-3257
Uncommenting line 5 in the run.rb fixes the warning.
@caponecicero Those are not reproductions. A reproduction is a set of commands to be run by anyone so that the error is reliably reproduced. You mentioned bundle update --all which works without warnings in many many cases, so a bit more than that is needed.
Thanks @martinsp. Unfortunately, I cloned the app and ruby run.rb runs on my system without any warnings, assuming ruby run.rb is what I need to run.
Ideally I'd need a Dockerfile reproducing your exact environment (ruby version manager, ruby version, rubygems version, list of gems installed, and son on) where the command produces the warning.
I also tried on a pristine Rails application using spring, since that has been mentioned too, but I couldn't reproduce the warning either :(
@caponecicero I'm seeing the .txt log that you provided but that includes paths in your netlify server and folders in your system. I need something that I can run on my system to reliably reproduce the error for myself.
@deivid-rodriguez sorry about incomplete details. I have updated the repository with a Dockerfile.
I can reproduce the issue by runing docker build --no-cache .
Here is the output I got:
docker build -t bundler-3257 .
Sending build context to Docker daemon 65.02kB
Step 1/6 : FROM ruby:2.7.0-buster
---> 556e761e192c
Step 2/6 : COPY bundler-3257 /bundler-3257
---> d37436eee42d
Step 3/6 : RUN ruby -v
---> Running in 4d0bc6f1d2eb
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
Removing intermediate container 4d0bc6f1d2eb
---> c0021479f575
Step 4/6 : RUN gem update bundler
---> Running in fdfe7831991d
Updating installed gems
Updating bundler
Successfully installed bundler-2.1.4
Gems updated: bundler
Removing intermediate container fdfe7831991d
---> 9528b91f704c
Step 5/6 : RUN gem list bundler
---> Running in 7a301e912fb5
bundler (2.1.4, default: 2.1.2)
Removing intermediate container 7a301e912fb5
---> e5dca7f2f132
Step 6/6 : RUN cd /bundler-3257 && ruby ./run.rb
---> Running in b2ac65bbd27f
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running gem install bundler:2.1.4.
Removing intermediate container b2ac65bbd27f
---> e8759d3ab20d
Successfully built e8759d3ab20d
Successfully tagged bundler-3257:latest
Thanks @martinsp!! I can repro now!
I'll investigate why the warning only reproduces on some environments and see what to do about it. :+1:
@caponecicero I'm seeing the .txt log that you provided but that includes paths in your netlify server and folders in your system. I need something that I can run on my system to reliably reproduce the error for myself.
Here you go:
Make sure bundler:2.1.4 is what you get when you run bundle:
stevewi:~/projects/bundle $ gem list
*** LOCAL GEMS ***
benchmark (default: 0.1.0)
bigdecimal (default: 2.0.0)
binman (5.1.0)
bundler (2.1.4, default: 2.1.2)
byebug (11.1.1)
...
stevewi:~/projects/bundle $ ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
stevewi:~/projects/bundle $ bundle update --all
Fetching gem metadata from https://rubygems.org/.............
Resolving dependencies...
Using bundler 2.1.4
Using sqlite3 1.4.2
Bundle updated!
stevewi:~/projects/bundle $ ./testsqlite
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
["one", 1]
["two", 2]
["Jane", "[email protected]", "A", "http://blog.janedoe.com"]
Now, uninstall bundler:2.1.4. Remove Gemfile.lock & test.db & rinse/repeat:
stevewi:~/projects/bundle $ bundle update --all
Fetching gem metadata from https://rubygems.org/.............
Resolving dependencies...
Using bundler 2.1.4
Using sqlite3 1.4.2
Bundle updated!
stevewi:~/projects/bundle $ ./testsqlite
["one", 1]
["two", 2]
["Jane", "[email protected]", "A", "http://blog.janedoe.com"]
Not necessary anymore @caponecicero, but thanks!
Ok, so this is a bug in the default bundler gemspec included with ruby 2.7.0. I was actually aware of this bug, but forgot about it. My apologies :grimacing:.
I'll work and propose a fix to ruby-core either later today or tomorrow so that it can be shipped with ruby 2.7.1.
For now, the workaround is to force reinstallation of the default bundler gemspec. You can do that by downgrading rubygems, and then upgrading it again: gem update --system 3.0.8 && gem update --system.
So even if the change in bundler's default gemspec in ruby 2.7.0 uncovered this issue, the actual issue is a bug in rubygems. I'm fixing it here: https://github.com/rubygems/rubygems/pull/3458.
For now I think the workaround given (downgrade and upgrade back rubygems) should work, because that will result in bundler specification being installed as a gemspec with the "new style", which doesn't suffer from the bug.
For me I would see this warning in Spring-enabled Rails apps on Ruby 2.7.0.
$ bin/rails console Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.My workaround is to modify
bin/springas follows:diff --git bin/spring bin/spring index d89ee49..8bf446f 100755 --- bin/spring +++ bin/spring @@ -4,6 +4,7 @@ # It gets overwritten when you run the `spring binstub` command. unless defined?(Spring) + gem 'bundler', '2.1.4' # Match BUNDLED WITH in Gemfile.lock require 'rubygems' require 'bundler'
bin/railsnow activates the correct version of Bundler and doesn't print a warning.
This works, it stooped getting warning :)
For me I would see this warning in Spring-enabled Rails apps on Ruby 2.7.0.
$ bin/rails console Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.My workaround is to modify
bin/springas follows:diff --git bin/spring bin/spring index d89ee49..8bf446f 100755 --- bin/spring +++ bin/spring @@ -4,6 +4,7 @@ # It gets overwritten when you run the `spring binstub` command. unless defined?(Spring) + gem 'bundler', '2.1.4' # Match BUNDLED WITH in Gemfile.lock require 'rubygems' require 'bundler'
bin/railsnow activates the correct version of Bundler and doesn't print a warning.
This is the solution right here.
The right solution should be released with rubygems 3.1.3 soon, and will just work without any user intervention. That is a good workaround though :)
For me installing th newest version (3.1.2) of RubyGems solved this issue. ð
gem update --system
This also worked for me!
Most helpful comment
Not necessary anymore @caponecicero, but thanks!
Ok, so this is a bug in the default bundler gemspec included with ruby 2.7.0. I was actually aware of this bug, but forgot about it. My apologies :grimacing:.
I'll work and propose a fix to ruby-core either later today or tomorrow so that it can be shipped with ruby 2.7.1.
For now, the workaround is to force reinstallation of the default bundler gemspec. You can do that by downgrading rubygems, and then upgrading it again:
gem update --system 3.0.8 && gem update --system.