varvet / pundit

Minimal authorization through OO design and pure Ruby classes
MIT License
8.28k stars 629 forks source link

Uninitialized constant Pundit::Authorization in Rails 7.0.1 #707

Closed 3zcurdia closed 2 years ago

3zcurdia commented 2 years ago

Hi I just tried to use the gem in a rails 7.0.1 project with ruby 3.1.0 and this is what I got from the console.

Loading development environment (Rails 7.0.1)
irb(main):001:0> Pundit::Authorization
(irb):1:in `<main>': uninitialized constant Pundit::Authorization (NameError)

I believe this could be related to the changes in the zeitwerk loading mechanism in the defaults for rails 7

A temporal solution I found was replacing in the Gemfile from rubygem to the GitHub version

gem "pundit", github: "varvet/pundit"
Burgestrand commented 2 years ago

This is not yet released. Please use the API documentation linked in the README instead of the code from the master branch.