简体   繁体   English

部署Rails应用时出现错误AWS弹性beantalk

[英]error deploying rails app aws elastic beanstalk

I'm using rails 5.00 i keep getting this error when trying to deploy to aws 我正在使用Rails 5.00,尝试将其部署到AWS时仍然收到此错误

[Instance: i-04fd37ed6913c4a8a] Command failed on instance. [实例:i-04fd37ed6913c4a8a]命令在实例上失败。 Return code: 5 Output: (TRUNCATED)...ng uglifier 3.0.2 Installing unf 0.1.4 Installing turbolinks 5.0.1 Installing activesupport 5.0.0.1 An error occurred while installing nokogiri (1.6.8), and Bundler cannot continue. 返回码:5输出:(TRUNCATED)... ng uglifier 3.0.2安装unf 0.1.4安装turbolinks 5.0.1安装activesupport 5.0.0.1安装nokogiri(1.6.8)时发生错误,并且捆绑器无法继续。 Make sure that gem install nokogiri -v '1.6.8' succeeds before bundling. 捆绑之前,请确保gem install nokogiri -v '1.6.8'成功。 Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. 挂钩/opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh失败。 For more detail, check /var/log/eb-activity.log using console or EB CLI. 有关更多详细信息,请使用控制台或EB CLI检查/var/log/eb-activity.log。

You have two options to resolve your issue: 您有两种选择来解决问题:

1) Add patch to .ebextensions/packages.config like this: 1)将patch添加到.ebextensions/packages.config如下所示:

packages:
  yum:
    patch: []

This would make the yum package manager install it before attempting to bundle install . 这将使yum软件包管理器在尝试bundle install之前先进行bundle install

2) Add a command config to .ebextensions/nokogiri_command.config like this: 2)将命令配置添加到.ebextensions/nokogiri_command.config如下所示:

commands:
  test:
    command: "bundle config build.nokogiri --use-system-libraries"

Either of these two options has worked for me. 这两种选择都对我有用。 Don't forget to commit before pushing to AWS. 在推送到AWS之前,请不要忘记提交。

I ran into the same error "Make sure that gem install nokogiri -v '1.6.8' succeeds before bundling." 我遇到了同样的错误“在捆绑之前,请确保gem install nokogiri -v'1.6.8'成功。”

It was due to me not selecting the correct deployment version for ruby. 这是由于我没有为ruby选择正确的部署版本。 Initially when creating the environment I had left the ruby platform at default which happened to be version 2.3 (Passenger). 最初,在创建环境时,我默认将ruby平台保留为2.3版(Passenger)。 Got the above error. 出现了以上错误。

I terminated the environment and re-created it but chose ruby 2.2 (Puma) which is what I am using in my development environment. 我终止了环境并重新创建了环境,但选择了我在开发环境中使用的ruby 2.2(Puma)。 The AWS environment was created without any errors. AWS环境已创建,没有任何错误。

Although the above corrective action fixed the problem, it does not explain why creating a ruby 2.3 (Passenger) environment failed especially since I did a sort of "canned" build - the environment creation was via AWS console using "sample application" in the config. 尽管上述纠正措施解决了该问题,但是它不能解释为什么创建ruby 2.3(Passenger)环境失败的原因,特别是因为我做了某种“罐装”构建-环境创建是通过AWS控制台使用配置中的“示例应用程序” 。 I did not attempt to create it via eb command line or use any of my elasticbeanstalk scripts or deploy my own app. 我没有尝试通过eb命令行创建它,也没有使用任何我的Elasticbeanstalk脚本或部署我自己的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM