我在亚马逊弹性beanstalk上创建了一个ruby环境,但是当我尝试使用eb deploy
从命令行部署我的rails应用程序时出现此错误:
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
You need to install git to be able to use gems from git repositories. For help
installing git, please refer to GitHub's tutorial at
https://help.github.com/articles/set-up-git (Executor::NonZeroExitStatus)
[2015-08-09T15:50:38.513Z] INFO [4217] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/10_bundle_install.sh] : Activity failed.
[2015-08-09T15:50:38.513Z] INFO [4217] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2015-08-09T15:50:38.513Z] INFO [4217] - [CMD-AppDeploy/AppDeployStage0] : Activity failed.
[2015-08-09T15:50:38.514Z] INFO [4217] - [CMD-AppDeploy] : Completed activity. Result:
Command CMD-AppDeploy failed.
那么,我应该直接在亚马逊实例bash上安装git吗?这会影响自动缩放吗?
答案 0 :(得分:0)
我不知道你是否解决了这个问题,但你需要告诉Elastic Beanstalk安装git
。
在项目的根目录中,添加名为.ebextensions
的文件夹。
在该文件夹中创建一个名为install_git.config
的文件(.config
很重要)。
将以下行添加到该文件中:
packages:
yum:
git: []
然后重新部署您的应用程序,您不应再看到该错误。