LoginSignup
0
0

More than 1 year has passed since last update.

vscode rails環境構築時のエラー rails s

Posted at

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.jsyarnをダウンロード、インストールを行わなければならなかったらしい。

肝心の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

成功!

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