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

Errno::ENOENT on install with Ruby 3.2 #199

Closed
marcotc opened this issue Dec 22, 2022 · 8 comments
Closed

Errno::ENOENT on install with Ruby 3.2 #199

marcotc opened this issue Dec 22, 2022 · 8 comments

Comments

@marcotc
Copy link
Contributor

marcotc commented Dec 22, 2022

docker run --rm -it ruby:3.2.0-slim-bullseye /bin/bash # sha256:5f509291214bb3d88d3fd490256860f09fbed9c3f8192aa715d95576018f9d91
# then inside the container
echo "source 'https://rubygems.org'; gem 'appraisal'" > Gemfile
bundle install
echo "appraise 'group' do gem 'os' end" > Appraisals
bundle exec appraisal install

Actual

>> bundle check --gemfile='/gemfiles/group.gemfile' || bundle install --gemfile='/gemfiles/group.gemfile' --retry 1
The Gemfile's dependencies are satisfied
bundler: failed to load command: appraisal (/usr/local/bundle/bin/appraisal)
/usr/local/bundle/gems/appraisal-2.4.1/lib/appraisal/appraisal.rb:102:in `read': No such file or directory @ rb_sysopen - /gemfiles/group.gemfile.lock (Errno::ENOENT)
	from /usr/local/bundle/gems/appraisal-2.4.1/lib/appraisal/appraisal.rb:102:in `relativize'
	from /usr/local/bundle/gems/appraisal-2.4.1/lib/appraisal/cli.rb:61:in `block in install'
	from /usr/local/bundle/gems/appraisal-2.4.1/lib/appraisal/appraisal_file.rb:27:in `each'
	from /usr/local/bundle/gems/appraisal-2.4.1/lib/appraisal/appraisal_file.rb:27:in `each'
	from /usr/local/bundle/gems/appraisal-2.4.1/lib/appraisal/appraisal_file.rb:11:in `each'
	from /usr/local/bundle/gems/appraisal-2.4.1/lib/appraisal/cli.rb:59:in `install'
	from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	from /usr/local/bundle/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
	from /usr/local/bundle/gems/appraisal-2.4.1/bin/appraisal:8:in `<top (required)>'
	from /usr/local/bundle/bin/appraisal:25:in `load'
	from /usr/local/bundle/bin/appraisal:25:in `<top (required)>'
	from /usr/local/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `load'
	from /usr/local/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `kernel_load'
	from /usr/local/lib/ruby/3.2.0/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/3.2.0/bundler/cli.rb:491:in `exec'
	from /usr/local/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/lib/ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
	from /usr/local/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/lib/ruby/3.2.0/bundler/cli.rb:28:in `start'
	from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/libexec/bundle:45:in `block in <top (required)>'
	from /usr/local/lib/ruby/3.2.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.1/libexec/bundle:33:in `<top (required)>'
	from /usr/local/bin/bundle:25:in `load'
	from /usr/local/bin/bundle:25:in `<main>'

It's interesting to note that The Gemfile's dependencies are satisfied is printed, but not accurate, since the example gem os is not installed yet.

Expected

Running with docker run --rm -it ruby:3.1.3-slim-bullseye /bin/bash I get:

bundle check --gemfile='/gemfiles/group.gemfile' || bundle install --gemfile='/gemfiles/group.gemfile' --retry 1
Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `bundle install`.
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Using rake 13.0.6
Using thor 1.2.1
Using bundler 2.3.26
Fetching os 1.1.4
Using appraisal 2.4.1
Installing os 1.1.4
Bundle complete! 2 Gemfile dependencies, 5 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
@skaes
Copy link

skaes commented Dec 25, 2022

still broken with the released Ruby 3.2.0

@Maimer
Copy link

Maimer commented Jan 8, 2023

This seems to be an issue with bundler version >= 2.4. Since Ruby 3.2 comes with the default bundler of 2.4.1 it breaks when running the bundle exec appraisal install command as the bundle check command no longer generates a lockfile. I have done some digging, but it's unclear to me why this behavior changed in bundler and the bundle check command.

I tested this fix: #200 as well as this fix: #201 and both seem to work. Seems like it's related to this change: rubygems/rubygems#6025.

@nickcharlton thoughts?

@nickcharlton
Copy link
Member

I've merged in #202, could someone try with that and see if it's still an issue?

@Maimer
Copy link

Maimer commented Jan 27, 2023

I've merged in #202, could someone try with that and see if it's still an issue?

@nickcharlton just tested it and it worked for me. Thanks!

@skaes
Copy link

skaes commented Jan 28, 2023

@nickcharlton works fine for me. tested with Ruby 2.7, 3.0, 3.1 and 3.2.

@nickcharlton
Copy link
Member

Great, thanks for letting me know!

I'm going to close this now but we'll add Ruby 3.2 to CI soon.

@petergoldstein
Copy link

Any chance we can get a release that includes this fix soon? It would fix a number of GitHub Actions CI pipelines that are currently broken.

@nickcharlton
Copy link
Member

nickcharlton commented Feb 1, 2023

It won't be long — I'd like to resolve #188 first, which I have in progress currently.

In the short-term, you could do something like: thoughtbot/administrate#1932 and pin against main.

argvniyx-enroute added a commit to argvniyx-enroute/uncruft that referenced this issue Jan 2, 2024
unpinned `appraisal` because of an issue with ruby 3.2 + bundler 2.4<=;
see
thoughtbot/appraisal#199 (comment)

unpinning gives us `appraisal 2.5.0`, version by which we have a fix (we
want to run `be appraisal install`) to generate lockfiles
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

5 participants