Does Gemfile need to include svg?

AI-generated summary

In a discussion regarding whether the Gemfile must include the svg gem, pfaffman reported Sidekiq warnings about a missing svgo binary. After running gem install svg, the warnings ceased, though they were unsure if this resolved their image URL issues or if it was coincidental. gerhard clarified that image optimization tools are typically provided by the Docker image rather than the Gemfile. They pointed to the Dockerfile and various install scripts for tools like gifsicle and pngquant. To resolve the warnings on an Ubuntu development VM, gerhard recommended installing system packages via apt and globally installing svgo via npm. pfaffman acknowledged the advice, noting confusion over conflicting Node.js versions installed via different methods. They suggested that the Ubuntu Development Guide and the install-rails/linux script should be updated to explicitly mention svgo, as neither currently includes it.

On my dev environment Sidekiq was whining that

svgo worker: `svgo` not found; please provide proper binary or disable this worker (--no-svgo argument or `:svgo => false` through options)

I finally did a gem install svg and restarted sidekiq. The message seems to have gone away (it only ever showed up sometimes, so I’m not entirely convinced).

Does Gemfile need to include:

gem 'svg'

So that bundle install would have installed it?

I can’t tell if this fixed my problem with image URLs not getting baked on my import or if that’s coincidence.

The image tools are usually provided by the Docker image. Take a look at the Dockerfile and the install scripts install-gifsicle, install-pngcrush and install-pngquant. I’m not sure if all of those are still used by Discourse.

I installed the following packages on my Ubuntu development VM in order to get rid of the warnings.

sudo apt install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng npm nodejs-legacy
sudo npm install svgo -g

Some of them are already installed by the script mentioned in the Beginners Guide to Install Discourse on Ubuntu for Development.

Thanks, @gerhard. Apparently I installed node some other way. Figuring out whether and when to install stuff via apt vs npm seems frought.

Egads. I think I installed node.js this weekend for some other reason some other way, so now I have npm@2.15.9 installed in /usr/bin and npm@3.3.6 in ~/.nvm/versions/node/v5.0.0/bin/npm.

Personal problems aside, @techAPJ, neither the Ubuntu Development Guide nor install-rails/linux mentions svgo. Perhaps you could update one of those?