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

Exception: FFI::NotFoundError when rrdtool was compiled without graphics support #27

Open
asomers opened this issue Sep 23, 2013 · 0 comments

Comments

@asomers
Copy link

asomers commented Sep 23, 2013

rrdtool can be compiled without graphics support with the configure command "./configure --disable-rrdcgi --disable-rrd_graph". If this was the case, then the rrd-ffi gem will throw an exception on import because it can't attach the :rrd_graph method. The attached patch will make that method optional. Tested on FreeBSD 9.1 amd64 with rrdtool version 1.4.7

--- lib/rrd/wrapper.rb.orig 2013-09-23 09:58:04.142000098 -0600
+++ lib/rrd/wrapper.rb 2013-09-23 09:58:42.762000022 -0600
@@ -47,7 +47,11 @@
attach_function :rrd_create, [:int, :pointer], :int
attach_function :rrd_dump, [:int, :pointer], :int
attach_function :rrd_first, [:int, :pointer], :time_t

  •  attach_function :rrd_graph, [:int, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer], :int
    
  •  begin
    
  •    attach_function :rrd_graph, [:int, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer], :int
    
  •  rescue FFI::NotFoundError => e
    
  •    warn "rrdtool was compiled without graphics support"
    
  •  end
    
    attach_function :rrd_info, [:int, :pointer], :pointer
    attach_function :rrd_last, [:int, :pointer], :time_t
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

1 participant