What's the equivalent of heroku-buildpack-magic on Render?

Is there a way to install libmagic in Render’s hosting environment?

Hi there,

Thanks for reaching out.

The heroku-buildpack-magic seems to set up a symlink to the existing library and copies over some header files. Based on the buildpack I was able to get a basic ruby-filemagic test working with a build script like this: https://gist.github.com/BigAlRender/935bd05b4155a3d1bda275a8cc991b7e

Hope that helps


@al_ps Thank you! This will work. I’m new to Render. What’s the proper way of running the build script once in a Web Service? I thought I might be able to just run it in Shell but it seems Shell is not accessible in all tiers so I thought maybe there’s a different way.

Render deploys works in a similar way to Heroku. First, you build your app (install dependencies, etc.), and then that built app image is run using the Start Command.

Using Shell will be looking at a pre-built, running instance, which has an ephemeral filesystem, so any new files written to it would be lost on the next deploy.

The notes in the gist show that you could put that script in your code base, then reference it in the service Build Command (on the Settings tab), e.g. save it in bin/render-build.sh of your project and set the Build Command on the service to ./bin/render-build.sh.



This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.