Search code examples
ruby-on-railsherokufile-permissionspdftk

How to edit permissions on Heroku application?


My problem in simple terms is that I have an executable that can't be run on Heroku, because it doesn't have the right permissions.

In more details, I have a RoR application on Heroku and I want to use server pdftk. But after installing it I need to chmod the file to be able to use it. And if I run a console on Heroku dashboard, put the chmod command in and try running pdftk it works, but it works just for that temporary dyno and it doesn't work on production server.

I tried creating .profile and putting the command in and that didn't work.
I tried creating Procfile and put release: chmod u+x /app/vendor/pdftk/bin/pdftk and it didn't work.
I tried all different versions of release, web, worker...
I tried creating a .sh file and putting the command in there and then running the file and it doesn't work either.

command for setting permission: chmod u+x /app/vendor/pdftk/bin/pdftk

If you need more info, please tell me.

Any help would be appreciated.


Solution

  • Okay, I figured out what the problem was. I have a pipeline from gitlab and the permissions just needed to be set through git, so that they were correct when they came to the production enviroment.

    I needed to run this code:git update-index --add --chmod=+x pdftk