在AWS Elastic Beanstalk上使用Webpacker gem部署Rails React应用 [英] Deploy rails react app with webpacker gem on AWS elastic beanstalk

查看:90
本文介绍了在AWS Elastic Beanstalk上使用Webpacker gem部署Rails React应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试部署rails 5.1&使用AWS Elastic Beanstalk反应使用webpacker gem创建的应用程序.问题是我不断收到以下错误:

I'm trying to deploy a rails 5.1 & react app created with webpacker gem using AWS Elastic Beanstalk. The problem is I keep getting the following error:

Webpacker requires Node.js >= 6.0.0 and you are using 4.6.0

我在计算机上使用Node 9.5.0.有什么建议吗?

I'm using Node 9.5.0 on my computer. Any suggestions??

推荐答案

要使用yum安装nodejs(假设您使用的是默认的Amazon Linux)

To install nodejs using yum (assuming you're using the default Amazon Linux)

https://nodejs.org/en/下载/包管理器/#enterprise-linux-and-fedora

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum -y install nodejs

现在要在您的实例上执行此操作,您需要将所需命令添加到.ebextensions目录内的配置文件中,例如:.ebextensions/01_install_dependencies.config

Now to execute this on your instances, you need to add the required commands to a config file inside the .ebextensions dir, something like: .ebextensions/01_install_dependencies.config

文件内容:

commands:
  01_download_nodejs:
    command: curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
  02_install_nodejs:
    command: yum -y install nodejs

这篇关于在AWS Elastic Beanstalk上使用Webpacker gem部署Rails React应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆