tags:

views:

49

answers:

1
+1  Q: 

History not saving

Why is my irb history no longer saving?

+1  A: 

It turns out that ruby 1.8.7 introduced a bug whereby finalizers are no longer guaranteed to run.

To resolve this, I added the following code snippet to my .irbrc file:

require 'irb/ext/save-history'

Kernel.at_exit do
  IRB::HistorySavingAbility.create_finalizer.call(IRB.CurrentContext.instance_variable_get(:@io).send(:binding))
end
Scott