Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropbox directory renaming resulting in 'URI::InvalidURIError: bad URI' on asset precompilation

I just upgraded my Dropbox account from a personal account to a business account. As a result it changed my main dropbox name from just 'Dropbox' to 'Company Name Dropbox'.

Now when I try to either launch my rails app or do a rails assets:precompile I get the following error:

$ rails assets:precompile
yarn install v1.22.0
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.15s.
rails aborted!
URI::InvalidURIError: bad URI(is not URI?): file-digest:///Users/name/Company Name Dropbox/Username/appfolder/jsp/app/assets/stylesheets/trestle/_variables.scss
/.rvm/gems/ruby-2.5.1@myapp/gems/sprockets-3.7.2/lib/sprockets/uri_utils.rb:45:in `split_file_uri'
/.rvm/gems/ruby-2.5.1@myapp/gems/sprockets-3.7.2/lib/sprockets/uri_utils.rb:126:in `parse_file_digest_uri'
/.rvm/gems/ruby-2.5.1@myapp/gems/sprockets-3.7.2/lib/sprockets.rb:159:in `block in <module:Sprockets>'
/.rvm/gems/ruby-2.5.1@myapp/gems/sprockets-3.7.2/lib/sprockets/dependencies.rb:67:in `resolve_dependency'
/.rvm/gems/ruby-2.5.1@myapp/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:23:in `block in initialize'
/.rvm/gems/ruby-2.5.1@myapp/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:59:in `resolve_dependency'

I have updated to the latest available version of Rails 5.2.4.3.

How do I resolve this without changing the location of my project? I need to leave it within my Dropbox folder.

like image 648
marcamillion Avatar asked Jun 20 '20 22:06

marcamillion


1 Answers

I think you need to use URI.encode(url) so that the whitespace is converted to %20.

like image 195
Dan M Avatar answered Oct 19 '22 13:10

Dan M