learnenough / rails_tutorial_sample_app_7th_ed

The reference sample app for the Ruby on Rails Tutorial (7th edition) by Michael Hartl
Other
75 stars 52 forks source link

Hidden dependency: libvips #1

Open slewsys opened 2 years ago

slewsys commented 2 years ago

This is not a bug, per say, but a hidden dependency. It appears that the gem ruby-vips does not check for the existence of libvips when installed. Consequently, when running the Rails Tutorial app, attempting to generate a thumbnail throws the error:

<Thread:0x00007fad07357c38 /home/alm/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/actionpack-7.0.2.3/lib/action_controller/metal/live.rb:340 run> terminated with exception (report_on_exception is true):

/home/alm/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/ffi-1.15.5/lib/ffi/library.rb:145:in `block in ffi_lib': Could not open library 'vips.so.42': vips.so.42: cannot open shared object file: No such file or directory. (LoadError) Could not open library 'libvips.so.42': libvips.so.42: cannot open shared object file: No such file or directory

After installing libvips, thumbnails are generated correctly.

At the time that bundle install was run ImageMagick was installed, so it's possible that this could mask some errors (e.g., the _imageprocessing gem), but I'm glad that libvips is being used instead.

Thank you for a great service :)