Project

General

Profile

ruby issue ? / (migrate to 3.0.1) ArgumentError (comparison of Time with BigDecimal failed) / app/models/setting.rb : @cached_cleared_on <= settings_updated_on

Added by Pierre PP over 9 years ago

sorry but I am a ruby newbie and this looks like a ruby issue ...

I installed redmine 3.0.1 on a debian 7 machine ... it worked ...

then I wanted to migrate my current redmine data to this redmine and I got some messages like :

ArgumentError (comparison of Time with BigDecimal failed):
app/models/setting.rb:194:in `<='
app/models/setting.rb:194:in `check_cache'
app/controllers/application_controller.rb:100:in `user_setup'

(line numbers might not be completely accurate as I added some debug messages)

the issue is here in app/models/setting.rb:

if settings_updated_on && @cached_cleared_on <= settings_updated_on

I converted @cached_cleared_on to a float and it seems to work now ...

I guess I am missing a gem that I need to install so that the comparison between a time and a decimal is working ??
thanks for any help !


Replies (3)

RE: ruby issue ? / (migrate to 3.0.1) ArgumentError (comparison of Time with BigDecimal failed) / app/models/setting.rb : @cached_cleared_on <= settings_updated_on - Added by Pierre PP over 9 years ago

PS some info :

/usr/local/redmine# RAILS_ENV=production bin/about

sh: 1: darcs: not found
sh: 1: hg: not found
sh: 1: cvs: not found
sh: 1: bzr: not found
Environment:
Redmine version 3.0.1.stable
Ruby version 1.9.3-p194 (2012-04-20) [x86_64-linux]
Rails version 4.2.0
Environment production
Database adapter MySQL
SCM:
Subversion 1.6.17
Git 1.7.10.4
Filesystem
Redmine plugins:
no plugin installed
root@1ssd00054:/usr/local/redmine#

RE: ruby issue ? / (migrate to 3.0.1) ArgumentError (comparison of Time with BigDecimal failed) / app/models/setting.rb : @cached_cleared_on <= settings_updated_on - Added by Martijn Jonker over 9 years ago

I have the same error. Can you please tell me how you converted cached_cleared_on to a float?

Edit: ok I figured it out, change

@cached_cleared_on = Time.now

to

@cached_cleared_on = Time.now.to_f 

in settings.rb

    (1-3/3)