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

Correct usage of cache_dir is unclear #2453

Open
lostapathy opened this issue Mar 4, 2020 · 0 comments
Open

Correct usage of cache_dir is unclear #2453

lostapathy opened this issue Mar 4, 2020 · 0 comments

Comments

@lostapathy
Copy link

Apologies this isn't a PR to improve the docs, but I've dug quite a bit and am not sure what the right answer is.

In README.md the example usage for cache_dir is:

If you store files outside the project root folder, you may want to define cache_dir in the same way:

class MyUploader < CarrierWave::Uploader::Base
  def cache_dir
    '/tmp/projectname-cache'
  end
end

However, this specific example (with the leading /), is not valid when used with the fog-aws backend. Some S3 providers will tolerate it (AWS S3 allows it via API, but not via their web console). Some providers will not allow it at all (minio rejects object names with a leading slash).

I haven't been able to track down docs that give me enough clarity on how cache_dir should be used to offer a PR, but it seems like this is a good candidate for improved docs, and ideally throwing an exception in the case where fog_aws is in use and an improper cache_dir has been specified. It took quite a bit of troubleshooting to figure this out and I'd like to save the next person the trouble. Thanks.

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