sferik / twitter-ruby

A Ruby interface to the Twitter API.
http://www.rubydoc.info/gems/twitter
MIT License
4.58k stars 1.31k forks source link

No such file or directory @ rb_sysopen, using upload_with_media method #951

Closed garcia-0E closed 5 years ago

garcia-0E commented 5 years ago

I'm trying to tweet an image with its status, however, i'm getting this error everytime i try to. I've tried everything and still cannot figure what's occasioning the error. I'm using carrierwave to process the images.

Current call

  @tweet = twitter.update_with_media('status' , File.open(@donation.images.first.picture.to_s) )

Error

No such file or directory @ rb_sysopen - /uploads/image/picture/74/banner5.png <- That's the image i'm trying to upload

PashaLVWD commented 5 years ago

Has nothing to do with Twitter gem. Error is coming from File.open

2.4.2 :029 >   File.open('/tmp/picture.png')
Errno::ENOENT: No such file or directory @ rb_sysopen - /tmp/picture.png
    from (irb):29:in `initialize'
    from (irb):29:in `open'
    from (irb):29
2.4.2 :030 >
garcia-0E commented 5 years ago

Yes, sorry. I've already figured it out what was wrong with my code. Thanks, anyway!

siddhartharun commented 3 years ago

@rt-garcia Can you share your solution? I'm stuck with the same problem.