Exec format error on Elastic Beanstalk postdeploy script

0

Trying to upgrade my rails app to Elastic Beanstalk on Amazon Linux2. I have the web part working. However, when I try to run a certain postdeploy hook, it fails with "exec format error". From the Rails console, I can run bundle exec whenever --update-cron, and it works. However, when I run the same thing in a postdeploy script, it fails with "exec format error." I've tried /bin/su -c "bundle exec whenever --update-cron", with and without double quotes. I just can't find how to make it work.

asked 2 years ago1636 views
2 Answers
0

An exec format error almost always means that the CPU architecture that your application was compiled with is not the same as the CPU architecture that you're deploying it to. For example, you might have built your application on an Intel machine, then copied it to an Amazon EC2 Graviton instance. Or you might have built the application on an M1 Mac, then copied it to an Amazon Intel or AMD EC2 instance.

AWS
EXPERT
answered 2 years ago
0

If you created the script file on Windows, you have to convert it to Linux format. dos2unix can do that.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions