【发布时间】:2019-06-24 13:49:18
【问题描述】:
我有一个 rubyonrails 网站,它的功能是当用户使用他的用户名注册时,它会在我的 github 帐户中的该用户名中创建一个 repo。它在heroku中完美运行。当我切换到亚马逊网络服务时,我最初得到了
intializing git
sh: git: command not found
sh: line 0: cd: /home/webapp: No such file or directory
我通过在.ebextensions 中添加一个配置文件来克服这个错误
commands:
01_mkdir_webapp_dir:
# use the test directive to create the directory
# if the mkdir command fails the rest of this directive is ignored
test: 'mkdir /home/webapp'
command: 'ls -la /home/webapp'
02_chown_webapp_dir:
command: 'chown webapp:webapp /home/webapp'
03_chmod_webapp_dir:
command: 'chmod 700 /home/webapp'
packages:
yum:
git: []
然后我有一个新的错误日志,例如
fatal: could not read Username for 'https://github.com ': No such device or address
当我在本地运行此脚本时,我在 localhost:3000 终端上注册了站点,提示我提交 github 用户名和密码。这正常吗。这是错误fatal: could not read Username for 'https://github.com ': No such device or address 的原因吗?
但这段代码在 heroku 中完美运行。
完整日志如下。 https://drive.google.com/file/d/1yPYsS1ETHhrEoYFWHJxt4y52jHYRkooj/view?usp=sharing
我在 aws 中设置了这些环境。 https://photos.app.goo.gl/GeQHXdUWUMuixTgNA
【问题讨论】:
-
你好,我不会碰weabpp文件夹,因为它已经为你做EB了
-
尝试提供 git 命令 /usr/bin/git 的完整路径
-
它仍然在终端中要求 github 用户名和密码
标签: ruby-on-rails git amazon-web-services github amazon-elastic-beanstalk