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

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

新規登録して質問してみよう
ただいま回答率
85.46%
Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

AWS(Amazon Web Services)

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

Q&A

0回答

912閲覧

AWSデプロイ時にwebpackerでエラー

Meitoku

総合スコア44

Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

AWS(Amazon Web Services)

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

0グッド

0クリップ

投稿2020/11/23 01:15

編集2020/11/23 07:52

自動デプロイをする時にwebpackerに関するエラーが発生してしまいます
Vue.jsを導入しようとこちらでwebpackerをインストールしました。
試しにGemfileのwebpackerをコメントアウトしてみるとデプロイは成功するので、webpackerが原因だと思っています
よろしくお願いします
この質問はマルチポストです 修正依頼参照

###エラー

NoMethodError: undefined method `strip' for nil:NilClass /var/www/baseball-app/shared/bundle/ruby/2.5.0/bundler/gems/webpacker-31b7a6f31e38/lib/tasks/webpacker/check_yarn.rake:6:in `block (2 levels) in <top (required)>' /var/www/baseball-app/shared/bundle/ruby/2.5.0/bundler/gems/webpacker-31b7a6f31e38/lib/tasks/webpacker/compile.rake:16:in `block in enhance_assets_precompile' /var/www/baseball-app/shared/bundle/ruby/2.5.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>' /home/ec2-user/.rbenv/versions/2.5.1/bin/bundle:23:in `load' /home/ec2-user/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>' Tasks: TOP => webpacker:compile => webpacker:verify_install => webpacker:check_yarn (See full trace by running task with --trace)

#####Gemfile

source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.5.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.3' # Use mysql as the database for Active Record gem 'mysql2', '0.5.2' # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets gem 'sass-rails', '5.0.7' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'mini_racer', platforms: :ruby # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use ActiveStorage variant # gem 'mini_magick', '~> 4.8' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'capistrano' gem 'capistrano-rbenv' gem 'capistrano-bundler' gem 'capistrano-rails' gem 'capistrano3-unicorn' end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of chromedriver to run system tests with Chrome gem 'chromedriver-helper' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'pry-rails' gem 'compass-rails', '3.1.0' gem 'sprockets', '3.7.2' gem 'kaminari' gem 'jquery-rails' gem "jquery-ui-rails" gem 'fullcalendar-rails' gem 'momentjs-rails' gem 'rails-i18n' gem 'devise' gem 'carrierwave' gem 'mini_magick' gem "font-awesome-sass" gem 'ancestry' gem 'fog' gem 'webpacker', github: 'rails/webpacker' gem 'bootstrap', '~> 5.0.0.alpha2' group :production do gem 'unicorn', '5.4.1' end

###追記
エラー

Tasks: TOP => deploy:assets:precompile (See full trace by running task with --trace) The deploy has failed with an error: Exception while executing as ec2-user@54.168.63.207: rake exit status: 1 rake stdout: yarn install v1.22.10 [1/4] Resolving packages... [2/4] Fetching packages... info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. Compiling... Compilation failed: yarn run v1.22.10 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command "webpack" not found.

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

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

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

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

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

maisumakun

2020/11/23 01:34

check_yarnでコケていますが、インスタンス内にyarnはインストールしていますか?
Meitoku

2020/11/23 01:44

はい、Vuetifyをインストールしようとyarnをインストールした記憶があります 結局Vuetifyは使いませんでした yarn -v 1.22.10
Meitoku

2020/11/23 02:46

yarn installでインストールしてますがyarnが原因なのでしょうか
maisumakun

2020/11/23 06:12

webpackerをGithub経由で入れているのはなにか理由があってでしょうか?(RubyGemsの最新版では動作しますか?)
Meitoku

2020/11/23 06:19

いえ、理由はありませんがGithub経由を止めても以上のエラーが発生します
maisumakun

2020/11/23 06:23

「yarn -v」はインスタンス内で行ってその結果でしょうか?
Meitoku

2020/11/23 07:32

ありがとうございます!インスタンス内ではありませんでした。 申し訳ありませんが error Command "webpack" not found.が発生したのですが、どういう原因が考えられるかご教授お願いできますでしょうか?
maisumakun

2020/11/23 07:47

「インスタンス内で」yarnをインストールし、yarn installも実行してみてください。
Meitoku

2020/11/23 07:51

はい、yarnは既にインストールしまして追記のようなエラーが発生しています
maisumakun

2020/11/23 08:03

うーん、すぐにはわからないですね。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問