Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
dump format error for symbol(0x6) - related to ruby issue #5564 #3644
I'm new to rails so it could be me, but I'm trying to run a newly created empty rails project on Windows 7 64 bit and getting the following:
[2011-11-16 11:05:21] INFO WEBrick 1.3.1
It's failing in template.rb on the line "conversions = Marshal.load(File.read(filename))", the code looks like this:
if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby' && RUBY_VERSION == '1.9.3' && RUBY_PATCHLEVEL == 0
This is a hack to work around a bug in Ruby 1.9.3p0:
Basically, at runtime we may need to perform some encoding conversions on the templates,
but if the converter hasn't been loaded by Ruby beforehand (i.e. now), then it won't be
able to find it (due to a bug).
However, we don't know what conversions we may need to do a runtime. So we load up a
marshal-dumped structure which contains a pre-generated list of all the possible conversions,
and we load all of them.
In my testing this increased the process size by about 3.9 MB (after the conversions array
is GC'd) and took around 170ms to run, which seems acceptable for a workaround.
The script to dump the conversions is: https://gist.github.com/1342729
filename = File.join(File.dirname(FILE), 'data', 'encoding_conversions.dump')
rescue => e
The comment suggests it's related to a fix for Rubyt issue #5564. Apologies if I'm posting to the wrong place.