Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tips on installing gifski on a heroku nodejs server #145

Open
AustinHatem opened this issue Oct 28, 2020 · 6 comments
Open

Tips on installing gifski on a heroku nodejs server #145

AustinHatem opened this issue Oct 28, 2020 · 6 comments

Comments

@AustinHatem
Copy link

AustinHatem commented Oct 28, 2020

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!

@kornelski
Copy link
Member

Can you describe the problem you have?

@AustinHatem
Copy link
Author

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.

@kornelski
Copy link
Member

kornelski commented Oct 29, 2020

/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.

@techpeace
Copy link

techpeace commented Aug 19, 2022

For anybody else wondering how to install gifski on Heroku:

  1. Add a working rust buildpack to your dyno:
heroku buildpacks:add https://github.com/vinceliu/heroku-buildpack-rust
  1. Add a Cargo.toml file to the root of your project and list gifski as 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"

@kornelski
Copy link
Member

Note that adding via [dependencies] installs a Rust-only library, and does NOT install the command-line version.

@techpeace
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@techpeace @kornelski @AustinHatem and others