Uploading a remote file url from Rails Console with Carrierwave

后端 未结 5 604
不思量自难忘°
不思量自难忘° 2020-12-25 10:46

I just wanted to know how one would go about uploading a remote file url using Carrierwave in the Rails console.

I tried the following without any luck. I presume it

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-25 11:20

    I was facing the same problem. and the issue might be http is redirecting to https. So I replaced them using gsub as follows:

    image.remote_image_url = remote_image_url.gsub('http://','https://')
    image.save!
    

    this should most probably solve the problem.

提交回复
热议问题