thoughtbot / appraisal

A Ruby library for testing your library against different versions of dependencies.
https://thoughtbot.com
MIT License
1.25k stars 107 forks source link

uninitialized constant Appraisal::DependencyList::Set on Ruby 3 #186

Closed bibendi closed 2 years ago

bibendi commented 2 years ago

Hi!

Looks like, the gem doesn't work on Ruby 3. I think we should explicitly require the set file.

bundler: failed to load command: appraisal (/bundle/ruby/3.0.0/bin/appraisal)
/bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal/dependency_list.rb:7:in `initialize': uninitialized constant Appraisal::DependencyList::Set (NameError)
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal/bundler_dsl.rb:13:in `new'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal/bundler_dsl.rb:13:in `initialize'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal/appraisal_file.rb:16:in `new'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal/appraisal_file.rb:16:in `initialize'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal/appraisal_file.rb:11:in `new'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal/appraisal_file.rb:11:in `each'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal/task.rb:32:in `block in initialize'
        from /bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task_manager.rb:232:in `in_namespace'
        from /bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/dsl_definition.rb:141:in `namespace'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal/task.rb:9:in `initialize'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal.rb:4:in `new'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/lib/appraisal.rb:4:in `<top (required)>'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/bin/appraisal:4:in `require'
        from /bundle/ruby/3.0.0/gems/appraisal-2.4.0/bin/appraisal:4:in `<top (required)>'
        from /bundle/ruby/3.0.0/bin/appraisal:23:in `load'
        from /bundle/ruby/3.0.0/bin/appraisal:23:in `<top (required)>'
        from /usr/local/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `load'
        from /usr/local/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `kernel_load'
        from /usr/local/lib/ruby/3.0.0/bundler/cli/exec.rb:28:in `run'
        from /usr/local/lib/ruby/3.0.0/bundler/cli.rb:474:in `exec'
        from /usr/local/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /usr/local/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from /usr/local/lib/ruby/3.0.0/bundler/cli.rb:30:in `dispatch'
        from /usr/local/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from /usr/local/lib/ruby/3.0.0/bundler/cli.rb:24:in `start'
        from /usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.2.22/libexec/bundle:49:in `block in <top (required)>'
        from /usr/local/lib/ruby/3.0.0/bundler/friendly_errors.rb:128:in `with_friendly_errors'
        from /usr/local/lib/ruby/gems/3.0.0/gems/bundler-2.2.22/libexec/bundle:37:in `<top (required)>'
        from /usr/local/bin/bundle:23:in `load'
        from /usr/local/bin/bundle:23:in `<main>'
bibendi commented 2 years ago

The working fix https://github.com/bibendi/appraisal/commit/627c1be9b44c118e8967ee8fee1591383797c993

ccutrer commented 2 years ago

I'm getting the same on ruby 2.7.2 and 2.6.6

luke-hill commented 2 years ago

Is this something that will be fixed in here thoughtbot? We're hitting the same issue on cucumber rails now in CI. I'll add the patch fix in for now.

nickcharlton commented 2 years ago

This has been resolved in #184. I'm swamped so far this week, but I'll have time on Friday to look at this and should be able to put out a release, too.

nickcharlton commented 2 years ago

Closing as I just merged in #184. Thanks for reporting this!