# Rake/Net::HTTP

**URL:** <https://www.ruby-forum.com/t/rake-net-http/131415>\
**Category:** Rails\
**Created:** [March 9, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/rake-net-http/131415 "2008-03-09T18:50:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdaoust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mdaoust](https://www.ruby-forum.com/u/mdaoust)\
**Post date:** [March 9, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/rake-net-http/131415/1 "2008-03-09T18:50:22Z")

</div>

Hello,

I have a class method in a class in my lib dir of my rails app which  
basically fetches some URLs and stores them in a temp cache for  
processing. When I run the code via the script/console it works fine,  
but if I create a rake task to call it and then run that rake task it  
moans:

rake workbooks:create  
(in /users/mark/desktop/workbooks)  
rake aborted!  
wrong status line: "HTTP/1.1 0 "

I believe it is this line in the class method which is causing the  
problem:

Net::HTTP.get\_response(URI.parse(url\_for\_fetch)).body

Any clues?

Thanks,

~ Mark
