Thursday, February 23, 2006

Errno::ENOENT when opening URL

If you are trying to open a URL and are getting the error mesage:

Errno::ENOENT



Make sure you have this statement:

require 'open-uri'

2 Comments:

At 4:10 PM, Blogger Unknown said...

. . .and where exactly do you put that statement?

 
At 3:49 AM, Blogger Nii Amon said...

you put it at the top of your class similar to the Java import statements.

I am having a strange error however and i would like some help. Whenever I am fetching a URL in my code I ALWAYS get this error:

"Stack level too deep"

This happens no matter which method and I have tried Net::HTTP GET and POST, open, open-uri and all return the same error. The strange thing is that when I put the same thing on the console I get it right. I am using locomotive as my default ruby environment but somehow I don't think it is a locomotive problem as I am able to get some of the methods working on the console. I am close to retiring to Java for this task and would like any assistance I can get.

Thanks.

 

Post a Comment

<< Home

eXTReMe Tracker