Ruby 1.9.1 with rspec "cannot modify a frozen object"

I just updated Ruby 1.9.1 and almost all of my rspec are broken, giving me "I can’t modify the frozen object." Even the rspec sample code from the rspec_controller generator fails.

RuntimeError in 'DownloadsController should use DownloadsController'
can't modify frozen object                                                                                                                                                          
/usr/local/lib/ruby19/1.9.1/timeout.rb:44:in `timeout'


Generated by the following code: 

it "should use DownloadsController" do
  controller.should be_an_instance_of(DownloadsController)
end

Can anyone help?

+5
source share
2 answers

Whether you use, you are not trying to drown out that which is nothing.

At 1.8, zero was not frozen. However, it is frozen in ruby ​​1.9.

+6
source

Try opening /usr/local/lib/ruby19/1.9.1/timeout.rband replacing line 44 as follows:

begin
  return yield(sec) if sec == nil or sec.zero?
rescue => e
  puts e.backtrace.join("\n")
  raise e
end

, , . , , , , .

0

All Articles