【问题标题】:Bower install failing on ElasticBeanstalk - cannot find GITBower 在 ElasticBeanstalk 上安装失败 - 找不到 GIT
【发布时间】:2016-03-23 21:43:34
【问题描述】:

我正在尝试将一个应用程序部署到使用 bower 下载一些库的弹性 beanstalk 上。我在部署时收到以下错误:

ERROR: [Instance: i-b4b8893d] Command failed on instance. Return code: 1 Output: bower jquery.cookie#~1.4.1      ENOGIT git is not installed or not in the PATH. 
container_command 04_bower_install in .ebextensions/01-flask.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

这是我的配置文件:

option_settings:
  "aws:elasticbeanstalk:container:python":
    WSGIPath: "app.py"
  "aws:elasticbeanstalk:container:python:staticfiles":
    "/static/": "static/"
packages:
  yum:
    libjpeg-turbo-devel: []
    libpng-devel: []
    freetype-devel: []
    git: []
commands:
  01_set_home:
    command: export HOME=/home/ec2-user
  02_get_sudo:
    command: echo Defaults:root \!requiretty >> /etc/sudoers 
  03_npm_install:
    command: sudo yum -y --enablerepo=epel install nodejs npm
  04_npm_install_bower:
    command: sudo npm install -g bower
container_commands:
  01_set_path:
    command: export PATH=$PATH
  02_set_home:
    command: export HOME=/home/ec2-user
  03_set_git:
    command: export ENOGIT=/usr/bin/git
    command: export GIT=/usr/bin/git
  04_bower_install:
    command: 'bower --allow-root install'
    env:
      HOME: /home/ec2-user
      ENOGIT: /usr/bin/git
      GIT: /usr/bin/git

根据我的谷歌搜索,人们建议确保 git 已安装,因此我将其添加到 packages > yum 指令中,确保导出 PATH 变量以及 GIT 变量。如您所见,我已经尝试了所有这些方法,但没有任何方法可以修复错误。

有什么想法吗? 谢谢 马克斯·芒福德。

【问题讨论】:

  • 您是否尝试过 SSH 进入您的一个实例以检查 git 是否实际安装?
  • 是的,“哪个 git”输出 /usr/bin/git
  • 确保您的凉亭配置使用完整路径。这里的问题不在于beantalk,而在于任何试图实际使用git的东西。它可能没有您放在 container_commands 中的有关 PATH 的更新信息。
  • @MaxMumford 你找到解决方案了吗?
  • @ibstr 不,如果我没记错的话,最后找到了解决方法...

标签: git bower amazon-elastic-beanstalk


【解决方案1】:

修复它:

  04_bower_update:
    command: "bower update --allow-root"
    env:
      "PATH": "/usr/bin"

【讨论】:

    猜你喜欢
    • 2018-03-08
    • 2018-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-10
    • 1970-01-01
    • 1970-01-01
    • 2012-01-08
    相关资源
    最近更新 更多