Error with Ruby 1.9 #10

Closed
vlasar opened this Issue Mar 25, 2011 · 6 comments

Projects

None yet

4 participants

@vlasar
vlasar commented Mar 25, 2011

When I follow the first two steps from your readme, after adding a model I first get the following:

zlib(finalizer): Zlib::GzipWriter object must be closed explicitly.
zlib(finalizer): the stream was freed prematurely.

When I run 'sitemap.generate' I get the following exception: https://gist.github.com/886702

Btw. I am using Rails 3.0.3 and PostgreSQL.

@inspire22

gzip is pretty easy to disable, try passing :gzip => false to the BigSitemap.new options and see if it works?

@gerbdla
gerbdla commented Apr 30, 2011

If anyone has an answer to fix this it would be appreciated besides just ignoring gzip altogether

@inspire22

your web server likely gzips things before it sends them anyways?

The source is pretty easy to read. Maybe the gzip block syntax changed for 4.1... Try doing file = Zlib::Gzipwriter.open, then write, then close it.

@alexrabarts
Owner

I can't recreate this by writing ASCII-8BIT characters to Zlib::GzipWriter. Do you have a test case that I can use to debug this?

@inspire22

From the gist looks like it was perhaps an invalid multi-byte string inside an ascii-8-bit string. Ruby 1.9 does weird stuff with things like this, I've struggled with it in other areas (though haven't had any problems with sitemaps)

@alexrabarts
Owner

This should be fixed as of version 1.0.0. However, please note that there have been some major changes in this version, including a new API, so please do consult the README before updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment