0

I am using carrierwave to upload images to google store. Is there some way to specify different buckets for different models. I tried keeping

config.fog_directory = '' 

in carrierwave.rb and then writing the name of buckets in store_dir in individual uploaders file but that gave following error:-

[fog][WARNING] fog: the specified google storage bucket name () is not a valid dns name. See: https://developers.google.com/storage/docs/bucketnaming Completed 500 Internal Server Error in 815ms (ActiveRecord: 1.1ms)

Excon::Errors::SocketError (getaddrinfo: No address associated with hostname >(SocketError)):

4
  • What kind of error it gave? It will help understanding the problem if you include the error and possibly stack trace. Feb 23, 2016 at 8:53
  • I included the error
    – Rndomcoder
    Feb 23, 2016 at 9:03
  • As the error states, either you are setting the bucket name to be () or " ", which is not valid bucket name. Check how you are setting it. Feb 23, 2016 at 9:06
  • If I set the bucket name in carrierwave.rb, I won't be able to use different buckets for different models.
    – Rndomcoder
    Feb 23, 2016 at 10:09

1 Answer 1

0

Found the answer finally on carrierwave wiki page.https://github.com/carrierwaveuploader/carrierwave/wiki/How-to%3a-Define-different-storage-configuration-for-each-Uploader.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.