Wiki Forum Sign up! Explore Home

Not signed in (Sign In)

LiveSearch

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.2 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorslifox
    • CommentTimeApr 24th 2007
     permalink
    While trying to use clockingit from source, I ran into this error:
    <code>
    can't modify frozen array
    #{RAILS_ROOT}/lib/localization.rb:38:in `replace'
    #{RAILS_ROOT}/lib/localization.rb:38:in `translate_strings'
    #{RAILS_ROOT}/lib/localization.rb:31:in `lang'
    #{RAILS_ROOT}/app/controllers/application.rb:59:in `authorize'
    </code>

    I'm not familiar at all with ruby, so this was a pain to figure out. However, I believe the problem is in the system's date.rb (/usr/lib/ruby/1.8/date.rb for me), line 252:

    <code>
    [MONTHNAMES, DAYNAMES, ABBR_MONTHNAMES, ABBR_DAYNAMES].each do |xs|
    xs.each{|x| x.freeze}.freeze
    end
    </code>

    For now, I've commented this out in my system's date.rb. However, there should be a solution that can be implemented in clockingit's source.

    Any ideas how?

    Alex
    • CommentAuthoradmin
    • CommentTimeApr 24th 2007
     permalink
    Ho hum... That's a bugger...

    I guess it should be possible to override the strftime function of Date, like I do with Time, and use local arrays instead of replacing the ones in the Date class. I'll see if I get the time to have a go at it tonight.