【问题标题】:/home/webapp: No such file or directory elastic beanstalk/home/webapp:没有这样的文件或目录弹性beantalk
【发布时间】:2019-06-20 18:38:57
【问题描述】:

当我使用弹性 beantalk 在 aws 上部署我的 ruby​​ 应用程序时。出现以下错误。 pass log

App 20278 stdout: intializing git
App 20278 stderr: error: could not lock config file /home/webapp/.gitconfig: No such file or directory
App 20278 stderr: sh: line 0: cd: /home/webapp: No such file or directory

eb log 请告诉我如何解决这个问题

编辑:当我在本地运行脚本时,我收到类似chmod: changing permissions of '.netrc': Operation not permitted 的错误。我认为这条线是应用程序无法工作的原因。 .netrc的内容是

machine github.com
login soumjo
password 123456

Sice 在脚本运行期间,它会在终端中询问 github 用户名和密码。 git_initializer.rb

system("echo intializing git")
`git config --global user.name soumjo
`git config --global user.email soumjo@gmail.com`
`cd && touch .netrc`
`chmod 600 .netrc`
File.write(".netrc",
    <<-HEREDOC
machine github.com
login soumjo
password 123456
HEREDOC
    )

【问题讨论】:

  • 需要写入权限。在 .gitconfig 文件上
  • 怎么办?不要
  • 分享你在.ebextensions里面有什么?

标签: ruby-on-rails ruby amazon-web-services amazon-ec2 amazon-elastic-beanstalk


【解决方案1】:

在 .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'

但我有新问题将在另一个线程中讨论。感谢您的支持。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-27
    • 2021-06-08
    • 2020-07-28
    • 1970-01-01
    • 2021-06-24
    相关资源
    最近更新 更多