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.

已提问 2 年前1650 查看次数
2 回答
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
专家
已回答 2 年前
0

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

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则