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 `sum' #33

Open
ruby232 opened this issue May 9, 2017 · 6 comments
Open

Undefined method `sum' #33

ruby232 opened this issue May 9, 2017 · 6 comments

Comments

@ruby232
Copy link

ruby232 commented May 9, 2017

I'm try run examples/simple.rb in master but throw this error:

entropy': undefined method `sum' for [2, 3, 1]:Array (NoMethodError)

Try gem version 0.5.0 and work find, maybe it introduced in pull request #32

@ruby232
Copy link
Author

ruby232 commented May 9, 2017

Fix add

require 'active_support'
require 'active_support/core_ext'

but i guess it not best solution

@igrigorik
Copy link
Owner

Guessing, you're on an older version of ruby?

This was introduced in 13aed0b. /cc @cheerfulstoic

@ruby232
Copy link
Author

ruby232 commented May 9, 2017

My version of ruby is 2.3.1

└─ $ ▶ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

@igrigorik
Copy link
Owner

Right, figures... Sum is 2.4+ http://blog.bigbinary.com/2016/11/02/ruby-2-4-introduces-enumerable-sum.html.

@cheerfulstoic I propose we revert the sum update until 2.3 is deprecated.

@cheerfulstoic
Copy link
Contributor

Yep, sorry about that! Just created #34 and #35

@cheerfulstoic
Copy link
Contributor

(Was editing in the UI and I couldn't see a way to do it in one PR)

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

No branches or pull requests

3 participants