Skip to content
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

GovukLogging is required before Railtie #123

Merged
merged 1 commit into from
Oct 4, 2019
Merged

Conversation

kevindew
Copy link
Member

@kevindew kevindew commented Oct 3, 2019

This ordering was causing a problem for govuk_publishing_components which prevented assets to be pre-compiled:

govuk_publishing_components git:(master) RAILS_ENV=production GOVUK_APP_DOMAIN=www.gov.uk GOVUK_WEBSITE_ROOT=https://www.gov.uk rake assets:precompile
rake aborted!
NameError: uninitialized constant GovukAppConfig::Railtie::GovukLogging
/Users/kevindew/govuk/govuk_publishing_components/spec/dummy/config/initializers/content_security_policy.rb:1:in `<top (required)>'
/Users/kevindew/govuk/govuk_publishing_components/spec/dummy/config/environment.rb:5:in `<top (required)>'
/Users/kevindew/govuk/govuk_publishing_components/Rakefile:18:in `block (2 levels) in <top (required)>'

This was due to the Railtie file executing it's initializer before the remaining files had been required. This can be resolved with the Railtie being required last.

This ordering was causing a problem for govuk_publishing_components which prevented assets to be pre-compiled:

```
govuk_publishing_components git:(master) RAILS_ENV=production GOVUK_APP_DOMAIN=www.gov.uk GOVUK_WEBSITE_ROOT=https://www.gov.uk rake assets:precompile
rake aborted!
NameError: uninitialized constant GovukAppConfig::Railtie::GovukLogging
/Users/kevindew/govuk/govuk_publishing_components/spec/dummy/config/initializers/content_security_policy.rb:1:in `<top (required)>'
/Users/kevindew/govuk/govuk_publishing_components/spec/dummy/config/environment.rb:5:in `<top (required)>'
/Users/kevindew/govuk/govuk_publishing_components/Rakefile:18:in `block (2 levels) in <top (required)>'
```

This was due to the Railtie file executing it's initializer before the remaining files had been required. This can be resolved with the Railtie being required last.
@kevindew kevindew requested a review from vanitabarrett October 3, 2019 16:19
@kevindew kevindew merged commit b22bada into master Oct 4, 2019
@issyl0 issyl0 deleted the kevindew-patch-1 branch October 30, 2019 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants