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

Asset precompilation stage cannot cope with filenames with spaces in them #505

Closed
samsondav opened this issue Aug 2, 2016 · 8 comments
Closed
Labels

Comments

@samsondav
Copy link
Contributor

Just updated react_on_rails to 6.0.5 and now I see this error precompiling assets:

React On Rails: Symlinking /Users/sam/code/projects/foo/public/assets/face on grey-93536981da08346bc1270aea2bcb27786769c3eb7b8f9966725a3b4bd3405202.png to /Users/sam/code/projects/foo/public/assets/face on grey.png
ln: grey.png: No such file or directory

Seems like React on Rails chokes on filenames with spaces in them.

@justin808
Copy link
Member

justin808 commented Aug 2, 2016

Yes! Good catch.

Here's an example of where this is happening:
https://github.com/shakacode/react_on_rails/blob/master/lib/react_on_rails/assets_precompile.rb#L44

@samphilipd Any chance that you can submit a PR that has:

  1. quotes the file name names (ln and rm commands in the file).
  2. has a spec with a file that has spaces in the names.

@samsondav
Copy link
Contributor Author

@justin808 It seems like this is caused because react_on_rails is trying to create non-digested versions of assets.

My question would be why not use something like this instead which is mature and has had all the bugs worked out?

@justin808
Copy link
Member

alexspeller/non-stupid-digest-assets#35 amongst other reasons:
https://github.com/alexspeller/non-stupid-digest-assets/issues

Seems like that doesn't work on Heroku.

And no tests!

@justin808 justin808 added the bug label Aug 3, 2016
@samsondav
Copy link
Contributor Author

@justin808 perhaps the asset linking part could be extracted out of react_on_rails into a separate gem?

I just feel like architecturally it's reaching a bit beyond scope here.

I'll see about a PR though if I have some time.

@justin808
Copy link
Member

@samphilipd Since we want React on Rails to handle CSS Modules well, this is a natural inclusion.

@justin808
Copy link
Member

@alleycat-at-git @robwise @samphilipd Rather than using ln -s source target, how about we use:

http://ruby-doc.org/core-2.2.0/File.html#method-c-symlink

We also need to set the directory:

http://apidock.com/ruby/FileUtils/cd

@dzirtusss Check this one out.

@dzirtusss
Copy link
Contributor

I have send PR closing this

@justin808
Copy link
Member

See #510.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants