【问题标题】:fatal: could not read Username for 'https://github.com ': No such device or address - rubyonrails - aws致命:无法读取“https://github.com”的用户名:没有这样的设备或地址 - ruby​​onrails - aws
【发布时间】:2019-06-24 13:49:18
【问题描述】:

我有一个 ruby​​onrails 网站,它的功能是当用户使用他的用户名注册时,它会在我的 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


【解决方案1】:

尝试直接创建git配置文件

#/home/webapp/.gitconfig
[user]
    name = soumjoyel
    email = soumjoyel@gmail.com

使用这个脚本

files:
  "/home/webapp/.gitconfig" :
    mode: "000644"
    owner: webapp
    group: webapp
    content: |
      [user]
        name = soumjoyel
        email = soumjoyel@gmail.com

【讨论】:

  • 还是一样的错误,fatal: could not read Username for 'https://github.com': No such device or address.
  • 怎么知道。我在完整日志pastebin.com/C3p3sTuM Puma 日志pastebin.com/wvcRGMXg 中有这些错误[已隔离]
  • 要摆脱一个错误,将 -p 选项添加到 -> mkdir -p /home/webapp'
  • 它是否创建了 .gitconfig 文件?
  • 抱歉这里是正确的 puma 日志pastebin.com/r1Dv9NxS 如何检查 .gitconfig 文件是否已创建?
猜你喜欢
  • 2013-09-24
  • 1970-01-01
  • 1970-01-01
  • 2013-03-22
  • 2017-05-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-03-09
相关资源
最近更新 更多