Ubuntu16.04.7 LTS Windows10 + Vegrant Rails 6.0.3
When I started rails, Webpacker exists, so I got an error message to install it, so I decided to install it.
$ rails s
Webpacker configuration file not found /vagrant/xxx/config/webpacker.yml.
Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /vagrant/xxx/config/webpacker.yml (RuntimeError)
However, when I try to install Webpacker, it asks me to install Yarn this time.
$rails webpacker:install
Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
For the installation method of Yarn, refer to the basic and official website. https://classic.yarnpkg.com/en/docs/install/#debian-stable
$curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
$echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
** Command description ** --apt-key is a command to add a new key to an existing key list. With --add-, it means to add to the key list from standard input. --tee is a command that writes standard output to a file and also displays it on the screen. --The URL of yarn's remote repository is written to yarn.list. --stable main is the stable version.
Use update to update the package index file before installing. It is a promise to update before installing the package.
$sudo apt update && sudo apt install yarn
** Command description ** Command 1 && Command 2 means that if command 1 completes successfully, command 2 will be executed.
Make sure Yarn is installed.
$yarn --version
1.22.5
rails s now works correctly.
$ rails s
Recommended Posts