LoginSignup
0
0

More than 3 years have passed since last update.

「rails s」で「webpacker」が出た時の対処法

Last updated at Posted at 2019-09-22

開発環境

windows
ruby 2.5
rails 6.0

エラー内容

rails newをしてサーバを立ち上げようと思ったら、エラー発生。

・・・(省略)

C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:91:in `rescue in load': Webpacker configuration file not found  Please run rails webpacker:install Error: No such file or directory @ rb_sysopen -  (一部省略)

まずは、言われている通りにする。

$ rails webpacker:install
Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/

yarnをインストールしろとのことなので、yarnをインストールする。
自分はnpmからインストールした。
なお、npmからインストールするにはnode.jsをインストールしておく必要がある。
node.jsのインストールに関してはこちらを参照。

$ npm install -g yarn

再び、webpackerをインストールする。

$ rails webpacker:install
・・・(省略)
$ rails s

2019-09-22 (1).png

参考

windows10にNode.jsをインストールする

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0