title: Can't modify frozen Fixnum on Ruby 2.0
body: <p>I have the following code:</p>
  <pre><code>require 'prime'
  class Numeric
    #... math helpers
  
    def divisors
      return [self] if self == 1
      @divisors ||= prime_division.map do |n,p|
        (0..p).map { |i| n**i }
      end.inject([1]) do |a,f|
        a.product(f)
      end.map { |f| f.flatten.reduce(:*) } - [self]
    end
  
    def divisors_sum
       @divisors_sum ||= divisors.reduce(:+)
    end
  
     #... more methods that evaluate code and 'caches' and assigns (||=) to instance variables
  end
  </code></pre>
  <p>Which outputs an error with:</p>
  <pre><code>&gt; 4.divisors
  /home/cygnus/Projects/project-euler/stuff/numbers.rb:24:in `divisors_sum': can't modify frozen Fixnum (RuntimeError)
  </code></pre>
  <p>The error disappears when I remove caching into the instance variables <code>@divisors</code>, <code>@divisors_sum</code>... etc. And this only happens on ruby 2.0. Ran it on 1.9.3 without issues. What's happening?</p>