After installing Rails on AWS Cloud9 for the first time, I got an error in the terminal when I tried to create a new app and launch a server.
Install Rails-v5 on Cloud9
$ gem install rails -v 5
Create a new 〇〇 app
$ rails new 〇〇
〇 〇 Move to the application directory
$ cd ~/environment/〇〇
Start the server
$ rails s -b $IP -p $PORT
: warning: ** Error occurred **: warning:
Looking at the error statement in the terminal, the error content was as follows.
Please run rails webpacker:install Error: No such file or directory
The error is that ** webpacker ** is not installed. It is the content.
I found out that the cause was that webpacker was not installed, so
$ rails webpacker install
Install ** webpacker **. At this time, ** yarn ** was not installed, so the following error occurred.
Yarn not installed.
Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
The error is that ** yarn ** is not installed. It is the content. ** yarn ** is required to install ** webpacker **, so install ** yarn ** first.
$ npm install -g yarn
Install ** yarn ** with the command. After installing ** yarn **, then install ** webpacker **.
$ rails webpacker install
If you can install ** webpacker **, it's OK.
After installing ** yarn ** and ** webpacker **, start the server again.
$ rails s -b $IP -p $PORT
The server started up successfully: thumbs up:
** webpacker: ** A Gem file that enables Rails to use webpack. It is for improving communication speed by combining JavaScript and CSS into one.
** yarn: ** JavaScript package manager. Mechanism for managing JavaScript
Recommended Posts