Problem: I encountered an error when trying to view product categories in the admin panel.
Expected Behavior: The categories page should display product categories including their name, description, and image.
Actual Behavior: An error occurs when trying to load the categories page:
LoadError in Admin::CategoriesController#index
Could not open library 'vips.so.42': vips.so.42: cannot open shared object file: No such file or directory.
Could not open library 'libvips.so.42': libvips.so.42: cannot open shared object file: No such file or directory.
Searched in <system library path>, /usr/lib, /usr/local/lib, /opt/local/lib
Environment:
OS: Ubuntu 22.04
Browser: Chrome Version 127.0.6533.119 (Official Build) (64-bit)
Steps to reproduce:
Navigate to admin
Click on "Categories" to view the list of product categories. (add a category if category is empty)
The error appears instead of the categories list.
Extracted Source (category.rb model file)
class Category < ApplicationRecord
has_one_attached :image
has_many :products
def image_as_thumbnail
image.variant(resize_to_limit: [50, 50]).processed
end
end
Description
Problem: I encountered an error when trying to view product categories in the admin panel.
Expected Behavior: The categories page should display product categories including their name, description, and image.
Actual Behavior: An error occurs when trying to load the categories page:
Environment:
Steps to reproduce:
Extracted Source (
category.rb
model file)