/家/ webapp的:没有这样的文件或目录弹性魔豆

问题描述 投票:1回答:1

当我部署使用弹性魔豆AWS我的红宝石应用程序。下面的错误发生。 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_intializer.rb

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

ruby-on-rails ruby amazon-web-services amazon-ec2 amazon-elastic-beanstalk
1个回答
0
投票

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

但是,我有新的问题,这将在另一个线程说话。感谢您的支持。

© www.soinside.com 2019 - 2024. All rights reserved.