morellon / rrd-ffi

A ruby wrapper for librrd (rrdtool) using ffi.
MIT License
71 stars 20 forks source link

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

Open asomers opened 11 years ago

asomers commented 11 years ago

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