Forum: Ruby on Rails openURI not capturing pages from the same rails app

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6d15bb497266caad1b7639bebf160d2c?d=identicon&s=25 Tom (Guest)
on 2007-05-15 11:53

I am using standard Ruby library openURI to capture the HTML code from
other pages. The problem openURI does not work for capturing pages from
the same rails application.

Here is the code:

class CdCreatorController < ApplicationController
require 'open-uri'

  def generate

    lines = []

    file = open(""){ |f|
f.each_line             {|line| lines << line}}

    @obj = lines

  def product
    @product = Product.find(params[:id]) {|f| f.each_line {|line| p
line} }


When I call method generate I get an TimeOut Error (execution expired).
But this method works just fine when I'm capturing pages from Internet
or local pages
with different port number.

Please help me.
A2c85dc5ee81b12e3cc0a6522e8d079d?d=identicon&s=25 Chris Hall (au5lander)
on 2007-05-15 12:14
(Received via mailing list)
i believe (someone correct me if i am wrong please) the answer is that
rails only handles one request at a time.  what this means is that
your app is waiting for the current (external) request to finish in
order to handle the next (internal) request from your open() call.

can i ask why you need to access your app this particular way?
4c0074d3780343ce520ba35f1e1e58cb?d=identicon&s=25 jqheller (Guest)
on 2007-05-15 16:48
(Received via mailing list)
I know it sounds crazy, but could it be a DNS issue?  Can your
webserver actually see itself?  I ask this because I recently dealt
with a similar situation (not using rails, but ASP.NET) where the
webserver has some screwy DNS issues where internal calls to
or localhost weren't routing properly.  Even doing a ping to
from commandline wouldn't work.
This topic is locked and can not be replied to.