views:

432

answers:

1

Hi,

I have a rails app (rails version 2.1.0) and today I found a very weird error.

A money value(mysql decimal column with precision 8 and scale 2) is 86.02. However, number_to_currency method returns "$86.20". This happens only in production server. My dev server returns correctly. The production server is red hat and dev is ubuntu.

This is also confirmed in console.

>> p.deposit_total.to_s 
=> "86.02"
>> helper.number_to_currency p.deposit_total 
=> "$86.20"

Is this a known issue?

Thanks.

Sam

A: 

For us this problem was caused by the wrong minor version of ruby. See: https://rhn.redhat.com/errata/RHBA-2010-0012.html

Server with the problem:

[auser@aserver01 ~]$ rpm -qa | grep ruby
ruby-libs-1.8.5-5.7
ruby-rdoc-1.8.5-5.7
ruby-1.8.5-5.7
ruby-devel-1.8.5-5.7
ruby-irb-1.8.5-5.7

Server without the problem:

[auser@aserver02 ~]$ rpm -qa | grep ruby
ruby-1.8.5-5.5
ruby-ri-1.8.5-5.5
ruby-irb-1.8.5-5.5
ruby-rdoc-1.8.5-5.5
ruby-libs-1.8.5-5.5
ruby-devel-1.8.5-5.5
Sam