2017-12-21 12 views
6

私は現在、webpackerで全く新しいruby/railsアプリケーションの設定をしています。 Herokuに展開するたびに、糸の依存関係を再インストールするのに30秒以上かかる(実行はyarn install)。Heroku Ruby/RailsキャッシュWebpack +デプロイ間の糸

remote:  [1/4] Resolving packages... 
remote:  [2/4] Fetching packages... 
remote:  info [email protected]: The platform "linux" is incompatible with this module. 
remote:  info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. 
remote:  [3/4] Linking dependencies... 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected] || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected] || 3". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^2.0.0 || ^3.0.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^3.1.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^2.0.0 || ^3.0.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^1.0.30000697". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^2.0.0 || >= 3.0.0-rc.0 || ^3.0.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^4.0.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^2.0.0 || >= 3.0.0-rc.0 || ^3.0.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]*". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected] || 2 || 3". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^5.0.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3.0.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^2.0.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^6.8.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]*". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^2.2.0 || ^3.0.0". 
remote:  warning "[email protected]" has incorrect peer dependency "[email protected]^1.0.0 || ^2.0.0 || ^3.0.0". 
remote:  [4/4] Building fresh packages... 
remote:  Done in 33.50s. 
remote:  Webpacker is installed 

私は現在、heroku-16スタックにheroku/ruby buildpackを使用しています。 キャッシュをbundlerのように動作させる簡単な方法はありますか?

答えて

2

たぶん、あなたはあなたのHerokuのスタックに加えて、a second nodejs buildpackを追加することができます。

heroku buildpacks:add --index 1 heroku/nodejs 

hereが説明したようnodejs buildpackは、糸のキャッシングをサポートする必要があります。

+0

ここでは、nodejsビルドパックの使用について説明しているrails/webpackerについての説明があります。https://github.com/rails/webpacker/issues/405#issuecomment-332682225 –

+0

これはRailsでは機能しません。 Herokuが糸の依存関係を2回確立している... – Stussa

+0

@DerekHopperのリンクでは、以前の人たちは、レールがデンプスを2度インストールするのを防ぐために、レールプロジェクトからbin/yarnを削除して成功を収めました。たぶんあなたはそれを試して、それが動作するかどうかを見ることができますか? また、キャッシングデプスが機能するときに、糸のインストールを2回実行する方が速いでしょうか? –

関連する問題