tomgi / git_stats

GitStats is a git repository statistics generator.
MIT License
1.08k stars 154 forks source link

undefined method `new' for BigDecimal:Class (NoMethodError) with Ruby 2.7.0 #106

Open DanySK opened 4 years ago

DanySK commented 4 years ago

Installing and using the tool with Ruby 2.7.0 throws the following error:

$ git_stats generate
Traceback (most recent call last):
        23: from /home/danysk/.gem/ruby/2.7.0/bin/git_stats:23:in `<main>'
        22: from /home/danysk/.gem/ruby/2.7.0/bin/git_stats:23:in `load'
        21: from /home/danysk/.gem/ruby/2.7.0/gems/git_stats-1.0.17/bin/git_stats:8:in `<top (required)>'
        20: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        19: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        18: from /home/danysk/.gem/ruby/2.7.0/gems/git_stats-1.0.17/lib/git_stats/cli.rb:2:in `<top (required)>'
        17: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        16: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        15: from /home/danysk/.gem/ruby/2.7.0/gems/git_stats-1.0.17/lib/git_stats.rb:5:in `<top (required)>'
        14: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        13: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        12: from /home/danysk/.gem/ruby/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/all.rb:3:in `<top (required)>'
        11: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        10: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         9: from /home/danysk/.gem/ruby/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext.rb:1:in `<top (required)>'
         8: from /home/danysk/.gem/ruby/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext.rb:1:in `each'
         7: from /home/danysk/.gem/ruby/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext.rb:2:in `block in <top (required)>'
         6: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
         5: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
         4: from /home/danysk/.gem/ruby/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext/object.rb:3:in `<top (required)>'
         3: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         2: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         1: from /home/danysk/.gem/ruby/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext/object/duplicable.rb:106:in `<top (required)>'
/home/danysk/.gem/ruby/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext/object/duplicable.rb:111:in `<class:BigDecimal>': undefined method `new' for BigDecimal:Class (NoMethodError)
malko commented 3 years ago

same here

cluen commented 3 years ago

Maybe a helpful workaround: I installed ruby with rvm install 2.5.1 on Ubuntu Subsystem on Windows, and it works

ts-ign0re commented 3 years ago

If you have rvm, just use ruby 2.6

rvm use 2.6

DanySK commented 3 years ago

Guys of course rolling back Ruby works. But that's hardly a solution. This is going to keep being an issue for the foreseeable future, I believe Ruby won't roll back changes introduced with 2.7.0.

Shaumik-Ashraf commented 2 years ago

For any future readers, add gem 'bigdecimal', '>= 2.5.5' to your Gemfile followed by bundle install. This fixes the issue on ruby 2.7.5.