我们elastic-beanstalk
用作我们的服务器。我们使用webpacker
withrails
来编译和捆绑一个react
应用程序。部署日志时,我们得到以下信息
yarn install v1.0.2
[1/4] Resolving packages...
Webpacker is installed
Using /var/app/ondeck/config/webpacker.yml file for setting up webpack paths
Compiling…
Compilation failed:
./bin/webpack:26:in `exec': No such file or directory - /var/app/ondeck/node_modules/.bin/webpack (Errno::ENOENT)
from ./bin/webpack:26:in `block in <main>'
from ./bin/webpack:25:in `chdir'
from ./bin/webpack:25:in `<main>'
(Executor::NonZeroExitStatus)
安装纱线包时出现错误,因为它不会进入第 2 步或第 4 步。
当我 ssh 进入服务器时,转到ondeck
包含我相信的最新代码的目录,然后运行yarn install
,我得到:
error Could not write file "/var/app/ondeck/yarn-error.log": "EACCES:
permission denied, open '/var/app/ondeck/yarn-error.log'"
error An unexpected error occurred: "EACCES: permission denied, mkdir
'/var/app/ondeck/node_modules'".
当我使用sudo yarn install
它时,当我使用 更新权限时sudo chmod -R 777 /var/app
,它就有效。所以我尝试将 chmod 命令添加到 a.ebextensions config file
但我没有运气。
奇怪的是,我们使用了两台服务器,elastic-beanstalk
而第一台使用相同的代码和配置文件正确部署。然后这个服务器没有正确部署,所以我不明白服务器之间的权限如何不同,除非有人手动更改它们。
我在这里在 webpacker 中创建了一个问题:https ://github.com/rails/webpacker/issues/810