upgrading from 1.2.3 to 1.2.4 does not update the generated inline file. This causes the latest commit (orientation logic) to not work. This is probably a bug in rubyinline.
You can create an extconf.rb that deletes ~/.ruby_inline (for every user)
@zenspider I liked your idea (on irc) about adding prefix to the md5. I think even if the inline file gets deleted on gem install, it doesn't fix switching back and forth between the two versions. But my knowledge of how this stuff is supposed to work is way limited.
for now, we are specifying a different INLINEDIR on deploy to fix the issue.
Ya know... I'm not sure that my original diagnosis is correct anymore:
should_compare = File.write_with_backup(src_name) do |io|
# recompile only if the files are different
recompile = true
if so_exists and should_compare and
FileUtils.compare_file(old_src_name, src_name) then
recompile = false
# Updates the timestamps on all the generated/compiled files.
# Prevents us from entering this conditional unless the source
# file changes again.
t = Time.now
File.utime(t, t, src_name, old_src_name, so_name)
I don't see why it didn't compile. Between so_exists, write_with_backup, and File.utime there isn't any reason why the md5 itself should have mattered. Am I missing something?
we aren't getting into that block.
unless so_exists and File.mtime(rb_file) < File.mtime(so_name) then
is evaluating to true so it thinks that so_name is up to date. This is at least what is happening in my repro. Not sure why my server was failing. I think its problem was it had issues recompiling but was able to use the old file.
Can you help me understand why you don't md5 the result of generate_ext()? That method appears to be cheap and it seems like you would want to know when anything changes.