Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring binstub causes Gem::LoadError after bundle update default gem with ext #697

Open
znz opened this issue Jul 6, 2023 · 0 comments
Open

Comments

@znz
Copy link

znz commented Jul 6, 2023

How to reproduce:

docker run --rm -it ruby:3.1-bullseye /bin/bash
mkdir app
cd app
bundle init
bundle config set --local path 'vendor/bundle'
bundle add rails -v '~> 6.1.0'
bundle exec rails new . --force -MOPCS --no-skip-spring --skip-listen -JT --skip-webpack-install
bundle exec spring binstub --all
bundle add io-wait -v 0.3.0
bin/rake

Result:

root@b77c1d65219e:/app# bin/rake 
/usr/local/lib/ruby/3.1.0/bundler/runtime.rb:308:in `check_for_activated_spec!': You have already activated io-wait 0.2.1, but your Gemfile requires io-wait 0.3.0. Since io-wait is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports io-wait as a default gem. (Gem::LoadError)
	from /usr/local/lib/ruby/3.1.0/bundler/runtime.rb:25:in `block in setup'
	from /usr/local/lib/ruby/3.1.0/bundler/spec_set.rb:155:in `each'
	from /usr/local/lib/ruby/3.1.0/bundler/spec_set.rb:155:in `each'
	from /usr/local/lib/ruby/3.1.0/bundler/runtime.rb:24:in `map'
	from /usr/local/lib/ruby/3.1.0/bundler/runtime.rb:24:in `setup'
	from /usr/local/lib/ruby/3.1.0/bundler.rb:161:in `setup'
	from /usr/local/lib/ruby/3.1.0/bundler/setup.rb:10:in `block in <top (required)>'
	from /usr/local/lib/ruby/3.1.0/bundler/ui/shell.rb:136:in `with_level'
	from /usr/local/lib/ruby/3.1.0/bundler/ui/shell.rb:88:in `silence'
	from /usr/local/lib/ruby/3.1.0/bundler/setup.rb:10:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/local/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /app/vendor/bundle/ruby/3.1.0/gems/spring-4.1.1/lib/spring/commands.rb:37:in `<module:Spring>'
	from /app/vendor/bundle/ruby/3.1.0/gems/spring-4.1.1/lib/spring/commands.rb:4:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/local/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /app/vendor/bundle/ruby/3.1.0/gems/spring-4.1.1/lib/spring/application.rb:87:in `preload'
	from /app/vendor/bundle/ruby/3.1.0/gems/spring-4.1.1/lib/spring/application.rb:166:in `serve'
	from /app/vendor/bundle/ruby/3.1.0/gems/spring-4.1.1/lib/spring/application.rb:148:in `block in run'
	from /app/vendor/bundle/ruby/3.1.0/gems/spring-4.1.1/lib/spring/application.rb:142:in `loop'
	from /app/vendor/bundle/ruby/3.1.0/gems/spring-4.1.1/lib/spring/application.rb:142:in `run'
	from /app/vendor/bundle/ruby/3.1.0/gems/spring-4.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/local/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from -e:1:in `<main>'

My investigation:

  • I cannot reproduce using default gem without ext. (e.g. net-pop)
  • Withoutbundle config set --local path 'vendor/bundle', I can upgrade. But I cannot downgrade. (e.g. if newer io-wait installed, bundle add io-wait -v 0.2.0 causes same error.)
  • bundle exec rake works well. So it caused by spring binstub.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant