-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
NameError: uninitialized constant error during rake assets:precompile using doorkeeper 5.6.3 #1651
Comments
Hey @denisahearn Do you still have an issue when upgrading to Doorkeeper 5.6.6 ? |
@nbulaj Yes, the same issue happens with doorkeeper 5.6.6. In fact that's the version we tried upgrading to yesterday when we experienced the issue. I isolated 5.6.3 as the version that introduced the issue. |
Could be related to changes in config evaluation, but it's always so hard to debug such things unfortunately |
Hey @nbulaj I ran into a similar problem with assets:precompile and doorkeeper. I run precompile in a CI context where there is no database configuration available so it fails when it tries to access certain environment variables in config/database.yml which shouldn't be loaded at all. This is called by the same lines in doorkeeper like for @denisahearn. To me it looks like orm hooks are run too early and we need to lazy load here as well because
At least this fixed the problem for me while keeping everything else functional. However, I am not an expert regarding Rails internals or doorkeeper. I am using doorkeeper for the first time here. Maybe this helps you isolate or even fixes the problem. :) |
Steps to reproduce
The following initializer and custom Doorkeeper::AccessToken model class work fine when using doorkeeper 5.6.2 within a Rails 7 app, but after upgrading to doorkeeper 5.6.3, a
NameError: uninitialized constant ApiSession
error happens while runningRAILS_ENV=production rake assets:precompile --trace
.This same error happens with the latest version of doorkeeper (5.6.6) as well.
Expected behavior
The
rake assets:precompile
command should work for doorkeeper 5.6.3 just like it does for 5.6.2Actual behavior
Running
RAILS_ENV=production rake assets:precompile --trace
with doorkeeper 5.6.3 results in the following error:System configuration
You can help us to understand your problem if you will share some very
useful information about your project environment (don't forget to
remove any confidential data if it exists).
Doorkeeper initializer:
Ruby version:
ruby 2.7.4p191
Gemfile.lock:
Gemfile.lock content
The text was updated successfully, but these errors were encountered: