Rails NoMethodError: undefined method new for BigDecimal:Class

As per the documentation of BigDecimal, for all Ruby versions 2.6.x, you should be using BigDecimal with a specific version:

The differences among versions are given below:

version  characteristics                                            Supported ruby version range
2.0.0    You cannot use BigDecimal.new and do subclassing           2.4 ..
1.4.x    BigDecimal.new and subclassing always prints warning.      2.3 .. 2.6
1.3.5    You can use BigDecimal.new and subclassing without warning .. 2.5

You can select the version you want to use using gem method in Gemfile or scripts. For example, you want to stick bigdecimal version 1.3.5, it works file to put the following gem call in you Gemfile.

gem 'bigdecimal', '1.3.5'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)