rails s
でエラーが起こった。
********@mbp jisaku_app % rails s
=> Booting Puma
=> Rails 7.0.2.3 application starting in development
=> Run `bin/rails server --help` for more startup options
Exiting
/Users/********/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/webpacker-5.4.3/lib/webpacker/configuration.rb:103:in `rescue in load': Webpacker configuration file not found /Users/********/jisaku_app/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /Users/********/jisaku_app/config/webpacker.yml (RuntimeError)
rails webpacker:install
した方がいいらしい。
行ったが下のエラーが出た。
********@mbp jisaku_app % rails webpacker:install
sh: node: command not found
sh: nodejs: command not found
Node.js not installed. Please download and install Node.js https://nodejs.org/en/download/
Exiting!
********@mbp jisaku_app % node -v
zsh: command not found: node
node.jsをダウンロードした方がいいらしい。
********@mbp jisaku_app % brew install node
.
.
.
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
ダウンロード成功。
もう一回 rails webpacker:install
してみた。
********@mbp jisaku_app % rails webpacker:install
Warning: you are using an unstable release of Node.js (v17.8.0). If you encounter issues with Node.js, consider switching to an Active LTS release. More info: https://docs.npmjs.com/try-the-latest-stable-version-of-node
Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
Exiting!
yarn
をインストールした方がいいらしい。
********@mbp jisaku_app % node -v
v17.8.0
********@mbp jisaku_app % brew install yarn
.
.
.
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`)
もう一回rails webpacker:install
*******@mbp jisaku_app % rails webpacker:install
.
.
.
Webpacker successfully installed 🎉 🍰
成功。
どうやらnode.js
とyarn
をダウンロード、インストールを行わなければならなかったらしい。
肝心のrails s
は...
*******@mbp jisaku_app % rails s
=> Booting Puma
=> Rails 7.0.2.3 application starting in development
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
.
.
.
Use Ctrl-C to stop
成功!