質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

解決済

1回答

1811閲覧

undefined method `strip' for nil:NilClassの原因がわからない

shin342

総合スコア22

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2021/01/08 14:36

前提・実現したいこと

デプロイのためにec2にログインした状態でbundle exec rails assets:precompile RAILS_ENV=productionを実行するとタイトルのエラーメッセージが出現します。
なにが原因なのか検討がつきませんでした。

発生している問題・エラーメッセージ

Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/install 〜省略〜 bin/rails: No such file or directory - yarn rails aborted! NoMethodError: undefined method `strip' for nil:NilClass /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/webpacker-5.2.1/lib/tasks/webpacker/check_yarn.rake:6:in `block (2 levels) in <main>' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/webpacker-5.2.1/lib/tasks/webpacker/compile.rake:14:in `block in enhance_assets_precompile' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/commands/rake/rake_command.rb:23:in `block in perform' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/commands/rake/rake_command.rb:20:in `perform' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/command.rb:48:in `invoke' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/commands.rb:18:in `<main>' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:291:in `block in require' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:257:in `load_dependency' /home/ec2-user/WebWorks/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:291:in `require' bin/rails:9:in `<main>' Tasks: TOP => webpacker:compile => webpacker:verify_install => webpacker:check_yarn

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

ec2にyarnをインストールすることで解決しました。

投稿2021/01/08 15:37

shin342

総合スコア22

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問