TypeError: can't modify frozen string in 1.8.6

i just upgrade ruby from 1.8.5 to 1.8.6. And now i get an error when
i’m dealing with dates :
TypeError: can’t modify frozen string
/opt/local/lib/ruby/1.8/date/format.rb:105:in chomp!' /opt/local/lib/ruby/1.8/date/format.rb:105:inmethod_missing’
/opt/local/lib/ruby/1.8/date/format.rb:963:in `_parse’

Does someone know where this error come from?

i confirm that it works with this fix…

On Aug 22, 1:56 am, Jean-Sébastien [email protected]

from ./script/console :

test = User.find 8
test.created_at
TypeError: can’t modify frozen string
from /opt/local/lib/ruby/1.8/date/format.rb:105:in chomp!' from /opt/local/lib/ruby/1.8/date/format.rb:105:inmethod_missing’
from /opt/local/lib/ruby/1.8/date/format.rb:963:in _parse' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/connection_adapters/abstract/schema_definitions.rb: 114:instring_to_time’
from (eval):1:in `created_at’
from (irb):7

it is not really verbose, but it’s all i get.

i just upgrade ruby from 1.8.5 to 1.8.6. And now i get an error when
i’m dealing with dates :
TypeError: can’t modify frozen string
/opt/local/lib/ruby/1.8/date/format.rb:105:in chomp!' /opt/local/lib/ruby/1.8/date/format.rb:105:inmethod_missing’
/opt/local/lib/ruby/1.8/date/format.rb:963:in `_parse’

Does someone know where this error come from?

My memory is that some of the methods in the date/time classes in ruby
became private in 1.8.6. Rails 1.2.3 fixes this, but if you’re on an
earlier version this may be it.

i just find a related topic : http://www.ruby-forum.com/topic/105957
i’ll try to patch format.rb and tell if it works for me too.

On Aug 21, 3:48 pm, Jean-Sébastien [email protected]

i’m on rails 1.2.3. maybe i should downgrade for a better
compatibilty.

Hi –

On Tue, 21 Aug 2007, Jean-Sébastien wrote:

My memory is that some of the methods in the date/time classes in ruby
became private in 1.8.6. Rails 1.2.3 fixes this, but if you’re on an
earlier version this may be it.

i’m on rails 1.2.3. maybe i should downgrade for a better
compatibilty.

I wouldn’t. It’s better to find and fix the problem. Can you show a
complete example, ideally from the application console?

David

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs