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

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

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

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

Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

Q&A

解決済

1回答

467閲覧

【rails6】deploy capistrano unicorn EC2 precompile error

kickthekaz

総合スコア29

Ruby on Rails 6

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

Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

0グッド

0クリップ

投稿2020/06/01 12:11

EC2にてrails6のアプリをデプロイしているのですが、bundle exec cap production deployすると、
deploy:assets:precompileのところでエラーになり止まってしまいます。。

エラー内容を確認すると、
The engine "node" is incompatible with this module. Expected version ">=8.16.0". Got "6.17.1"
と記載があるので、nodeのバージョンかなと思って、nodeのバージョンを確認したところ、v12.17.0(product環境)でした。
一応develop環境でも、確認したらv13.10.1でした。

エラーの6.17.1で何??と疑問です。

以下がエラーコードです。

00:10 deploy:assets:precompile 01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile 01 yarn install v1.22.4 01 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies cause… 01 [1/4] Resolving packages... 01 [2/4] Fetching packages... 01 error @rails/webpacker@4.2.2: The engine "node" is incompatible with this module. Expected version ">=8.16.0". Got "6.17.1" 01 error Found incompatible module. 01 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. #<Thread:0x00007fd2693b9d20 /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 13: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 12: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in `run' 11: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in `instance_exec' 10: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capistrano-rails-1.5.0/lib/capistrano/tasks/assets.rake:67:in `block (4 levels) in <top (required)>' 9: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:92:in `within' 8: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capistrano-rails-1.5.0/lib/capistrano/tasks/assets.rake:68:in `block (5 levels) in <top (required)>' 7: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:100:in `with' 6: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/capistrano-rails-1.5.0/lib/capistrano/tasks/assets.rake:69:in `block (6 levels) in <top (required)>' 5: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:80:in `execute' 4: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute' 3: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `tap' 2: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute' 1: from /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/netssh.rb:170:in `execute_command' /Users/kazuhiro/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/command.rb:97:in `exit_status=': rake exit status: 1 (SSHKit::Command::Failed)

お分かりになる方、ご教授いただけませんでしょうか。

よろしくお願いします。

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

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

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

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

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

guest

回答1

0

自己解決

自己解決しました!
アプリではなく、EC2内のnodeのバージョンが低いことが原因でした。。

https://qiita.com/shota0701nemoto/items/980c613dfc9be9586792

こちらの記事を参考に解決できました。。

投稿2020/06/02 08:24

kickthekaz

総合スコア29

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.47%

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

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

質問する

関連した質問