statsample icon indicating copy to clipboard operation
statsample copied to clipboard

Incompatibility with Ruby-2.0.0 ?

Open lokeshh opened this issue 9 years ago • 1 comments

I get this error on running rnorm on Ruby-2.0.0.

lokeshh:~/workspace $ rvm use 2.0.0-p647
Using /home/ubuntu/.rvm/gems/ruby-2.0.0-p647
lokeshh:~/workspace $ irb
2.0.0-p647 :001 > require 'statsample'
 => true 
2.0.0-p647 :002 > Statsample::Shorthand.rnorm 10
NoMethodError: undefined method `to_h' for #<Enumerator: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]:each_with_index>
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p647/gems/daru-0.1.3.1/lib/daru/index.rb:61:in `initialize'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p647/gems/daru-0.1.3.1/lib/daru/index.rb:32:in `block in new'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p647/gems/daru-0.1.3.1/lib/daru/index.rb:32:in `tap'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p647/gems/daru-0.1.3.1/lib/daru/index.rb:32:in `new'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p647/gems/daru-0.1.3.1/lib/daru/vector.rb:1246:in `try_create_index'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p647/gems/daru-0.1.3.1/lib/daru/vector.rb:110:in `initialize'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p647/gems/daru-0.1.3.1/lib/daru/vector.rb:144:in `new'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p647/gems/daru-0.1.3.1/lib/daru/vector.rb:144:in `new_with_size'
        from /home/ubuntu/.rvm/gems/ruby-2.0.0-p647/gems/statsample-2.0.2/lib/statsample/shorthand.rb:45:in `rnorm'
        from (irb):2
        from /home/ubuntu/.rvm/rubies/ruby-2.0.0-p647/bin/irb:12:in `<main>'

lokeshh avatar Aug 07 '16 03:08 lokeshh

Can you introduce backports as a runtime dependency?

v0dro avatar Aug 09 '16 17:08 v0dro