uninitialized constant AuthorizeApiRequest::JsonWebToken
Was a weird error.I build fully functioning apps locally before deployment. Locally when running rails server, this error never came up.
When I deployed the app to heroku, I then started receiving that error.
I thought adding “require ‘jwt'” might help, but it didn’t.
This comment by MikaOY pointed me in the right direction:
“Turns out it isn’t a problem with the AuthO implementation, just that libs/ is not included by auto-loaded by default in some versions of Rails.”
Well, I looked in application.rb and I was already autoloading lib. But it pushed me in the right direction.
I specifically had to require_relative the rb file that contained JsonWebToken. Still looking into why that is so, especially since I have a working instance locally. It could just be something with heroku. But hope this helped someone.
June 5, 2020 at 5:23 pm
Yes! This helped me as I was experiencing this exact issue. Thanks!
LikeLike