前提・実現したいこと
EC2で
terminal
1$ git pull origin master
からの
terminal
1% bundle exec cap production deproy
で今までデプロイしてきましたが、おそらくプルリクエスト前にgit pull origin masterをしてしまったのが原因かJavaScript関連での原因と思いますが、デプロイができなくなりました。
発生している問題・エラーメッセージ
termnal
1% bundle exec cap production deproy
すると
error
100:10 deploy:assets:precompile 2 01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile 3 01 yarn install v1.22.5 4 01 [1/4] Resolving packages... 5 01 [2/4] Fetching packages... 6 01 info fsevents@2.1.3: The platform "linux" is incompatible with this module. 7 01 info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 8 01 info fsevents@1.2.13: The platform "linux" is incompatible with this module. 9 01 info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. 10 01 [3/4] Linking dependencies... 11 01 warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". 12 01 warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0". 13 01 [4/4] Building fresh packages... 14 01 Done in 11.94s. 15 01 yarn install v1.22.5 16 01 [1/4] Resolving packages... 17 01 [2/4] Fetching packages... 18 01 info fsevents@2.1.3: The platform "linux" is incompatible with this module. 19 01 info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. 20 01 info fsevents@1.2.13: The platform "linux" is incompatible with this module. 21 01 info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. 22 01 [3/4] Linking dependencies... 23 01 warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". 24 01 warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0". 25 01 [4/4] Building fresh packages... 26 01 Done in 4.37s. 27 01 rake aborted! 28 01 Sass::SyntaxError: wrong number of arguments (given 4, expected 1..3) for `rgb' 29 30-------- 31省略 32-------- 33 34** DEPLOY FAILED 35** Refer to log/capistrano.log for details. Here are the last 20 lines: 36 37 38/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths' 39 40/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:228:in `block in stat_tree' 41 42/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:212:in `block in stat_directory' 43 44/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `each' 45 46/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `stat_directory' 47 48/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:227:in `stat_tree' 49 50/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `each' 51 52/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `block in logical_paths' 53 54/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `each' 55 56/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `logical_paths' 57 58/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:140:in `find' 59 60/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile' 61 62/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define' 63 64/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger' 65 66/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define' 67 68/var/www/アプリ名/shared/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>' 69 70/home/ec2-user/.rbenv/versions/2.6.5/bin/bundle:23:in `load' 71 72/home/ec2-user/.rbenv/versions/2.6.5/bin/bundle:23:in `<main>' 73 74 DEBUG [557c0069] Tasks: TOP => assets:precompile 75 76 DEBUG [557c0069] (See full trace by running task with --trace)
というエラーが表示されました。
試したこと
error
1DEBUG [557c0069] Tasks: TOP => assets:precompile
とあったので
terminal
1tail log/capistrano.log 2less log/capistrano.log
を実行してログを確認してみましたが、どの部分を確認すればいいか多すぎて取り組めない状況です。
assets:precomlileで止まるので、
terminal
1less log/production.log
を試してみましたが、特に期待するようなエラーはありませんでした。
したが実行結果です。
asset precompileについて言及しているみたいで調べてみると
JavaScriptの読み込みができていないという記事は見つけましたが、ローカル環境では普通に動いている状況です。
javascript
1// This file is automatically compiled by Webpack, along with any other files 2// present in this directory. You're encouraged to place your actual application logic in 3// a relevant structure within app/javascript and only use these pack files to reference 4// that code so it'll be compiled. 5 6require("@rails/ujs").start() 7require("turbolinks").start() 8require("@rails/activestorage").start() 9require("channels") 10require('jquery') 11require('../scroll') 12require('../modal') 13 14 15// Uncomment to copy all static images under ../images to the output folder and reference 16// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) 17// or the `imagePath` JavaScript helper below. 18// 19// const images = require.context('../images', true) 20// const imagePath = (name) => images(name, true)
JavaScript関連のgemを追加してみました。
gemfile
1gem 'sprockets-es6'
補足情報(FW/ツールのバージョンなど)
ruby 2.6.5
rails 6.0.0
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/12/02 05:09
2020/12/02 06:53
2020/12/02 07:32