-
Notifications
You must be signed in to change notification settings - Fork 253
Starting with Rails 6 | uninitialized constant Knock::Authenticable #250
Comments
when will the new version(2.2) come out? because with my new project I can't use this gem for this |
The last commit 9214cd0 from March 16 should work with Rails 6. If you can't wait specify the commit in your gemfile and update later to version 2.2:
|
THANKS!!!!! |
@sbrocos , After referencing the git branch and ref as you suggested, I get the error 'Could not find generator 'knock:install'.' I added the line 'config.load_defaults 6.0 and config.autoloader = :classic' to my application.rb and still no change in output. |
@Tripple-A Did you ever figure out how to get things working? I'm stuck around this point as well. Strangely, the current readme for knock doesn't even mention generators, but all blog posts I'm finding do mention generators. Maybe they are no longer used? It's really unclear how my token controller is meant to look. |
I didn't, it appears it isn't compatible with Rails 6.0 yet. I eventually
used another gem for authentication.
…On Wed, Jun 17, 2020, 19:36 David Gay ***@***.***> wrote:
@Tripple-A <https://github.com/Tripple-A> Did you ever figure out how to
get things working? I'm stuck around this point as well. Strangely, the
current readme for knock doesn't even mention generators, but all blog
posts I'm finding *do* mention generators. Maybe they are no longer used?
It's really unclear how my token controller is meant to look.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#250 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMRHFUDO3A2WTLJQOPLNF53RXEELDANCNFSM4J3HGRJA>
.
|
For any future travelers, I figured it out. I've got knock working in my Rails 6 API. I wrote up the details here: https://davidgay.org/programming/jwt-auth-rails-6-knock/ |
It's coming up on a year since this was opened, will version 2.2 ever be released? |
Hello from the future! Still no 2.2, huh? |
Starting a fresh Rails 6 project and including Knock:Authenticable results in an error:
uninitialized constant Knock::Authenticable
Everything works when starting with Rails 5.2.3 and and then updating to Rails 6.
There are also errors when using the generators:
rails generate knock:install
[WARNING] Could not load generator "generators/knock/install_generator". Error: expected file /Users/thomas/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/knock-2.1.1/lib/generators/knock/install_generator.rb to define constant InstallGenerator, but didn't.
rails generate knock:token_controller user
[WARNING] Could not load generator "generators/knock/token_controller_generator". Error: expected file /Users/thomas/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/knock-2.1.1/lib/generators/knock/token_controller_generator.rb to define constant TokenControllerGenerator, but didn't.
NameError (uninitialized constant Knock::Authenticable)
The text was updated successfully, but these errors were encountered: