Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby - open("file_path") - Errno::ENOENT: No such file or directory

Tags:

ruby

I keep getting this No such file or directory error when trying to open a file. I'm doing:

file = open("http://farm7.static.flickr.com/6064/6090089285_242ca0e342_m.jpg") according to the ruby-doc and keep getting such error.

What am I doing wrong?

like image 979
Gustavo Avatar asked Dec 12 '11 18:12

Gustavo


1 Answers

You have to

require 'open-uri'

Without requiring 'open-uri', I got this exact error mesage in my irb: Errno::ENOENT: No such file or directory

like image 60
Marek Příhoda Avatar answered Sep 19 '22 18:09

Marek Příhoda