sprockets
sprockets copied to clipboard
Fix: Path with spaces throws a bad URI(is not URI?) error
This PR fixes the issues described in this issue and in this comment.
Expected behavior
When a Rails or Sprockets project is placed in a directory with spaces in the folder names in the path, it shouldn't throw any errors. It should just escape the path name and work like normal.
Actual behavior
Once you put your project in a folder that has spaces in the path name, it throws the following error:
bad URI(is not URI?): "file-digest:///Users/username/Company Name Dropbox/User Name/ProjectName/myapp/app/assets/config/bootstrap"`
System configuration
- Sprockets 4.0.2 (also been able to replicate it in 3.7.2)
- Ruby 2.7.1 (also been able to replicate it in 2.5.1)
- Rails 6.0.3.2 (also been able to replicate it in 5.2.4.3)
===========
This issue surfaced once I upgraded my Dropbox account (which my Rails project is in) from a personal account (with no spaces in the name of the Dropbox folder) to a business account that has spaces -- which I couldn't control.