# A weird problem with open-uri

**URL:** <https://www.ruby-forum.com/t/a-weird-problem-with-open-uri/130234>\
**Category:** Rails\
**Created:** [February 26, 2008, 4:53pm UTC](https://www.ruby-forum.com/t/a-weird-problem-with-open-uri/130234 "2008-02-26T16:53:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stanislav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@stanislav](https://www.ruby-forum.com/u/stanislav)\
**Post date:** [February 26, 2008, 4:53pm UTC](https://www.ruby-forum.com/t/a-weird-problem-with-open-uri/130234/1 "2008-02-26T16:53:57Z")

</div>

Hi all,

I found a very weird problem/bug with open-uri today. In my application  
I have this line:  
html\_file = open(@story.url)

It raises this Exception:  
OpenURI::HTTPError - 404 Not Found

This is the url: [jwak.net&nbsp;-&nbsp;This website is for sale!&nbsp;-&nbsp;jwak Resources and Information.](http://jwak.net/media/844/) . There’re no problems with  
it. Moreover if I execute the same thing in the console (script/console)

- it just works as expected. I start both - the server and the console  
in dev.mode .

When the “open” method is executed through the application it returns  
this objects as response: (inside open-uri lib).  
#Net::HTTPNotFound:0x2aaaaea89890

When I call open in the console the response insite open-uri lib is:  
#Net::HTTPOK:0x2aaaab48d570

System spec:  
Fedora 8  
Rails 2.0.2  
Ruby 1.8.6

I’ll appreciate any help about where the problem could be. 10x in  
advance.

---

<div class="post-metadata">

**Author:** ![stanislav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@stanislav](https://www.ruby-forum.com/u/stanislav)\
**Post date:** [February 27, 2008, 4:52am UTC](https://www.ruby-forum.com/t/a-weird-problem-with-open-uri/130234/2 "2008-02-27T04:52:04Z")

</div>

i guess just pass as static url and then see if it works…

if it does then the decl of @story.url is not proper…try to get the  
value that ur getting in that variable and then checkout…

hope this helps…
