Skip to content

Conversation

@mayorova
Copy link
Contributor

What this PR does / why we need it:

Fixing a regression from #4145

The issue is:

NoMethodError: undefined method `assets' for #<Rails::Application::Configuration:0x000000000048d0>
Did you mean?  asset_host
/opt/system/vendor/bundle/ruby/3.1.0/gems/railties-7.1.5.2/lib/rails/railtie/configuration.rb:109:in `method_missing'
/opt/system/config/application.rb:189:in `<class:Application>'
/opt/system/config/application.rb:60:in `<module:System>'
/opt/system/config/application.rb:44:in `<top (required)>'

That's because before that PR, while gem 'sprockets-rails' was inside the :assets group, gem 'sass-rails', now removed, was outside (so, applied globally), and as it had sprockets-rails as its dependency anyway, it was available everywhere, and enabled config.assets for Rails configuration.

We only need dartsass-rails and non-digest-assets for example at the assets precompiling stage. However, sprockets-rails is needed in production too, as it actually implements the logic of serving the assets, so I have moved it accordingly.

Which issue(s) this PR fixes

-none-

Verification steps

Building with openshift/system/Dockerfile should work.

Special notes for your reviewer:

Copy link
Contributor

@akostadinov akostadinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I'm just wondering if we se the assets gems isolated somewhere. That could be a problem because then we will not have the sprockets. But probably not. Doesn't make too much sense.

@mayorova
Copy link
Contributor Author

Makes sense. I'm just wondering if we se the assets gems isolated somewhere. That could be a problem because then we will not have the sprockets. But probably not. Doesn't make too much sense.

Hm... I think the ungrouped gems are instlaled always, regardless of whether we use --with or --without in bundler.

@mayorova mayorova merged commit 047d785 into master Nov 28, 2025
15 of 19 checks passed
@mayorova mayorova deleted the fix-production-build branch November 28, 2025 09:18
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.

3 participants