Registry / utility / ffi
library1.17.4rbrubygemsunverified

Ruby FFI library provides a way to dynamically load and call native C functions from Ruby using a foreign function interface.

gem install ffi
INSTALL
IMPORT
SIG · FFI
F
ffi
utilityrubyv1.17.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FFI
✓ require 'ffi'

Attach the C puts function and call it from Ruby.

require 'ffi' module MyLib extend FFI::Library ffi_lib 'c' attach_function :puts, [:string], :int end MyLib.puts('Hello from C!')
Debug
Known issues
gotchaFFI can cause segmentation faults if memory is mismanaged; ensure proper type declarations.
fix
Use FFI::MemoryPointer and manage memory carefully; test thoroughly.
affects: >= 0.0.0
Upgrade
Version history
1.17.4latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
ffi — gem install ffi · libregistry