前提・実現したいこと
rails sの実行
発生している問題・エラーメッセージ
rails sを実行しようとすると、webpackerをインストールするようにいわれ、webpackerをインストールしようとするとyarnがないとわれるのでインストールして、再度webpackerをインストールしようとするとyarnが無いと言われ.ループしてしまいます。
該当のソースコード
rails s => Booting Puma => Rails 6.0.1 application starting in development => Run `rails server --help` for more startup options Exiting Traceback (most recent call last): 79: from bin/rails:3:in `<main>' 78: from bin/rails:3:in `load' 省略 Webpacker configuration file not found /home/pi/mari/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /home/pi/mari/config/webpacker.yml (RuntimeError)
試したこと
#webpackerのインストール
rails webpacker:install Traceback (most recent call last): 2: from /usr/local/bin/yarn:23:in `<main>' 1: from /var/lib/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:480:in `block in replace_bin_path' /var/lib/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:460:in `block in replace_bin_path': can't find executable yarn for gem yarn. yarn is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception) Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
yarnのインストール
$ sudo apt-get update && sudo apt-get install yarn 取得:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB] ヒット:2 https://dl.yarnpkg.com/debian stable InRelease ヒット:3 http://archive.raspberrypi.org/debian buster InRelease 15.0 kB を 6秒 で取得しました (2,356 B/s) パッケージリストを読み込んでいます... 完了 パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 yarn はすでに最新バージョン (1.19.1-1) です。 アップグレード: 0 個、新規インストール: 0 個、削除: 0 個、保留: 0 個。
yarnバージョン確認
yarn -v [DEPRECATION] This gem has been renamed to optimist and will no longer be supported. Please switch to optimist as soon as possible. Yarn v0.1.1 2011 Jesper Kjeldgaard
rails sを実行するにはどのようにすればよいのでしょうか。ご教示願います。
あなたの回答
tips
プレビュー