Giter Club home page Giter Club logo

Comments (13)

morellon avatar morellon commented on August 30, 2024

Which version of ruby are you using?
Which version of rrd-ffi are you using?

I've tested here from source and it seems to work on ruby 1.8.7 and 1.9.2.preview.

from rrd-ffi.

rizzah avatar rizzah commented on August 30, 2024

jruby 1.4.0 (ruby 1.8.7 patchlevel 174)
rrd-ffi 0.2.2 throws it, rrd-ffi 0.2.1 does not

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

thanks rizzah, i will take a look at it with jruby

from rrd-ffi.

rizzah avatar rizzah commented on August 30, 2024

Cool, thanks. Its definitely something within the block for rrd.rb and the wrapper.rb as well. For instance I commented the block out in the rrd.rb, then received the same error in the wrapper.rb.

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

rizzah, could you please test it from the source here. i added a small fix and now it seems to work on jruby as well. Can you confirm please?
I'm not very proud of this solution though. It will figure how to solve it in a more fancy way later :)

Thanks for the feedback!

from rrd-ffi.

rizzah avatar rizzah commented on August 30, 2024

That got it to load. Seeing a new issue when calling functions out of it...

rrd_file = "/tmp/_opt.rrd"
@graph = RRD.graph :start => Time.now - 1.day, :end => Time.now do
  for_rrd_data "usage", :usage => :last, :from => rrd_file
  print_value "usage", :format => "%3.2lf%%"
end

NoMethodError (undefined method reduce' for {:start=>1271178593, :end=>1271264993, :title=>""}:Hash): gems/gems/rrd-ffi-0.2.2/lib/rrd/graph.rb:85:insave'
gems/gems/rrd-ffi-0.2.2/lib/rrd.rb:17:in `graph'

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

In my environment the tests did pass. I made some changes, removing the reduce method. Can i have your help again?

from rrd-ffi.

rizzah avatar rizzah commented on August 30, 2024

Sure, got this...

TypeError (can't convert Hash into String):
file:lib/jruby-stdlib-1.3.1.jar!/ffi/memorypointer.rb:9:in from_string' gems/gems/rrd-ffi-0.2.2/lib/rrd/wrapper.rb:314:into_pointer'
gems/gems/rrd-ffi-0.2.2/lib/rrd/wrapper.rb:314:in each' gems/gems/rrd-ffi-0.2.2/lib/rrd/wrapper.rb:314:into_pointer'
gems/gems/rrd-ffi-0.2.2/lib/rrd/wrapper.rb:148:in graph' gems/gems/rrd-ffi-0.2.2/lib/rrd/graph.rb:89:insave'
gems/gems/rrd-ffi-0.2.2/lib/rrd.rb:17:in `graph'

for what its worth i just changed the reduce methods to inject, which is essentially the same method, received the same error

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

Try the latest changes from source, to see if it works.

I removed the reduce method, using only each_pair method now.

from rrd-ffi.

rizzah avatar rizzah commented on August 30, 2024

TypeError (can't convert Hash into String):
file:lib/jruby-stdlib-1.3.1.jar!/ffi/memorypointer.rb:9:in from_string' gems/gems/rrd-ffi-0.2.2/lib/rrd/wrapper.rb:314:into_pointer'
gems/gems/rrd-ffi-0.2.2/lib/rrd/wrapper.rb:314:in each' gems/gems/rrd-ffi-0.2.2/lib/rrd/wrapper.rb:314:into_pointer'
gems/gems/rrd-ffi-0.2.2/lib/rrd/wrapper.rb:148:in graph' gems/gems/rrd-ffi-0.2.2/lib/rrd/graph.rb:89:insave'
gems/gems/rrd-ffi-0.2.2/lib/rrd.rb:17:in `graph'

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

Graph using jruby is working for me. I can't reproduce this error.
I saw you are using "lib/jruby-stdlib-1.3.1.jar", may it be jruby version 1.3 instead of 1.4?

I tested using jruby 1.4.0 from rvm.

from rrd-ffi.

rizzah avatar rizzah commented on August 30, 2024

hm yup..got it to work. Thanks for the assistance.

from rrd-ffi.

rizzah avatar rizzah commented on August 30, 2024

close

from rrd-ffi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.