Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4631

wrong number of arguments (given 1, expected 0; required keywords: io, filename) - Active Storage

$
0
0

I'm having a problem with active storage after upgrading rails version to 7.1.2. I am trying to run this code:

banner = Banner.newimg_url = "https://t3.ftcdn.net/jpg/04/75/78/56/360_F_475785604_HDtTcxBFA0Av87F7JoFmpircCcatQ22b.jpg"picture = URI.open(img_url, {ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE})banner.img_v2.attach(io: picture, filename: File.basename(picture), key: "banners/v2/#{File.basename(picture)}.png")banner.save

And i am getting following error on banner.save or banner.img_v2.url:

/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activestorage-7.1.2/app/models/active_storage/blob.rb:87:in `build_after_unfurling': wrong number of arguments (given 1, expected 0; required keywords: io, filename) (ArgumentError)

I found this issue closest to mine but it didn't help. Appreciate for any help or suggestion.


Viewing all articles
Browse latest Browse all 4631

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>