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

RAILS_RELATIVE_URL_ROOT=.. passed into rake assets:precompile results in path ../../assets/foo rather than ../assets/foo #505

Open
david-pink opened this issue Mar 22, 2022 · 0 comments

Comments

@david-pink
Copy link

I work on a project which runs rake assets:precompile during a docker build stage, rather than at runtime. Since we don't know the URL root at buildtime, we pass in RAILS_RELATIVE_URL_ROOT=.. and this successfully builds our assets and makes them available regardless of the URL root passed into the container.

However, when we upgraded sprockets-rails from 3.2.2 to 3.3.0, this no longer works as the generated path for the assets is ../../assets/foo rather than ../assets/foo as it was before. The result is we can access the assets when no URL root is provided, but when one is provided we can't.

I believe the logic that broke this was introduced in pull request 476. Could I request a patch 3.x.y fix for this please? I realise this may not be a supported use case, hence why I haven't seen any evidence that anyone else has hit it, but it's blocking us from updating to a later sprockets-rails version, so a fix would be much appreciated.

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

No branches or pull requests

1 participant