On Mon, Mar 10, 2025 at 05:01:35AM -0000, DJ B wrote:
Hi! I installed libguestfs using apt-get through the dockerfile
currently installed: libguestfs-tools 1:1.36.13-1ubuntu3 ruby version: ruby 2.3.8p459
at first, the file was not in the load path so I added where the file guestfs.rb is at, but then it had the error inside guestfs.rb LoadError: cannot load such file -- _guestfs
I don't exactly know why it can't find it. It's likely to be a packaging problem with Ubuntu. The file it's looking for is called something like '/usr/lib64/ruby/vendor_ruby/_guestfs.so' (perhaps with a different path). If you can find that file, you could set $RUBYLIB to point to the directory. In Fedora it works fine, after installing the ruby-libguestfs package, without any need to set environment variables: $ irb irb(main):001> require 'guestfs' => true irb(main):002> g = Guestfs::Guestfs.new() => #<Guestfs::Guestfs:0x00007f217ca65550> Also if you build from source you can use the ./run script which sets up the environment variables correctly for Ruby: https://github.com/libguestfs/libguestfs/blob/01909c51ff54c7f3f31c566f6cc3a3... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org