Error with Ruby 1.9 #10

vlasar opened this Issue Mar 25, 2011 · 6 comments


None yet

4 participants

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:

Btw. I am using Rails 3.0.3 and PostgreSQL.


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

gerbdla commented Apr 30, 2011

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


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 =, then write, then close it.


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?


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)


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