私は今自分のWEBアプリをherokuにアップロードしようとしているのですが、下記のようなエラーが起こります。(cloud9でコーディングしています)
console
1$ git push heroku master 2..... 3remote: -----> Installing node-v10.14.1-linux-x64 4remote: -----> Detecting rake tasks 5remote: -----> Preparing app for Rails asset pipeline 6remote: Running: rake assets:precompile 7remote: Yarn executable was not detected in the system. 8remote: Download Yarn at https://yarnpkg.com/en/docs/install 9remote: I, [2019-05-22T02:13:47.373334 #1766] INFO -- : Writing /tmp/build_fcc84922ee6a02bfc05a163c871d0548/public/assets/noimage-3aa3997354b4e9c37f379deb61626f55ade493078d1b42dcefe4a3ccbed34106.jpg 10remote: rake aborted! 11remote: ExecJS::RuntimeError: SyntaxError: Unexpected character '`' 12remote: JS_Parse_Error.get ((execjs):3538:621) 13remote: (execjs):4060:48 14remote: (execjs):1:102 15..... 16remote: ! 17remote: ! Precompiling assets failed. 18remote: ! 19remote: ! Push rejected, failed to compile Ruby app.
自分なりに発見ことはまず、実行可能なYarnがないということですが、
yarn -vで調べるときちんとダウンロードされています。
またExecJS::RuntimeError: SyntaxError: Unexpected character '`'というエラーはes6が認知されていないということらしく、解決法として
config.assets.js_compressor = :uglifierを
config.assets.js_compressor = Uglifier.new(harmony: true)
に変えました。これでes6も読み取れるらしいのですが。しかし上記のようなエラーが依然として続きます。
またコンソールで rake assets:precompile RAILS_ENV=production
を打つと普通にエラーなく実行されます。
どなたかご教授お願い致します。
あなたの回答
tips
プレビュー