Publish to static pages

I need to “publish” pages to static files (in order to transfer to a
server where Rails isn’t available, this is not for caching).

When I do:

require “open-uri”

def publish
File.open(publish_path, “w”) do |file|
open(base_view_path) { |res| file.write(res.read) }
end
end

where publish() is a method on a model running in Rails (base_view_path
is a method returning an URL to the page to publish but in “view mode”).
The problem here seems to be that Webrick hangs… (I guess Webrick just
can handle a request at a time or something and it deadlocks)

Is there another solution to this problem?

Regards,

/Marcus