gifski
gifski copied to clipboard
Tips on installing gifski on a heroku nodejs server
Hello, I am fairly new to gifski and I'm trying to get it setup on my heroku node js server. I am trying to start it with a child_process command.
const util = require('util'); const exec = util.promisify(require('child_process').exec);
then trying to start it:
const { stdout, stderr } = await exec(gifski);
I'm having issues getting it working. Is this how someone would go about doing this? Any tips would be much appreciated!
Can you describe the problem you have?
So I think my main issue is just installing gifski on heroku :
2020-10-28T22:38:04.093580+00:00 app[web.1]: /bin/sh: 1: gifski: not found
Since there is no buildpack for heroku I've been trying to use the .deb file to upload it to heroku. Would be nice in the future to have a buildpack but hopefully I can figure this out without it.
/bin/sh: 1: gifski: not found means you haven't got gifski command in your path, i.e. it's not installed. You need to upload gifski binary to your server and either put it somewhere it expects it (e.g. /usr/bin) or update PATH variable with its location, or use an absolute path to the executable.
I can't help you with Heroku-specific problems. You need to ask them how they want executables to be uploaded/installed.
For anybody else wondering how to install gifski on Heroku:
- Add a working rust buildpack to your dyno:
heroku buildpacks:add https://github.com/vinceliu/heroku-buildpack-rust
- Add a
Cargo.tomlfile to the root of your project and listgifskias a dependency:
[package]
name = "my-app"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
gifski = "1.7.0"
Note that adding via [dependencies] installs a Rust-only library, and does NOT install the command-line version.
Thanks, @kornelski! I (clearly) don't have any Rust experience.
I ended up using heroku-buildpack-apt and defining an Aptfile in the root of my project that lists a link to the .deb from the latest release
https://github.com/ImageOptim/gifski/releases/download/1.7.1/gifski_1.7.1_amd64.deb