Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DanySK opened this issue May 18, 2020 · 5 comments · May be fixed by #110
Open

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

DanySK opened this issue May 18, 2020 · 5 comments · May be fixed by #110

Comments

@DanySK
Copy link

DanySK commented May 18, 2020

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
Copy link

malko commented Aug 18, 2020

same here

@cluen
Copy link

cluen commented Aug 27, 2020

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

@SwagDevOps SwagDevOps linked a pull request Jan 4, 2021 that will close this issue
@ts-ign0re
Copy link

If you have rvm, just use ruby 2.6

rvm use 2.6

@DanySK
Copy link
Author

DanySK commented Apr 9, 2021

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants