Herokuへデプロイ時のエラーが解決できない。Precompiling assets failed
解決済
回答 1
投稿
- 評価
- クリップ 0
- VIEW 1,169
前提・実現したいこと
Herokuへデプロイしたいです。
Ruby on Railsでアプリケーションを作り、Herokuへデプロイしたいのですが、エラーが出て、数時間悩まされ続けています。
発生している問題・エラーメッセージ
Precompiling assets failed.が赤く表示されています。
該当のソースコード
以下、git push heroku masterした後のターミナルです。
一部文字数のため、fetch成功のところを省略しています。
remote: Bundle complete! 27 Gemfile dependencies, 73 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Post-install message from sass:
remote:
remote: Ruby Sass is deprecated and will be unmaintained as of 26 March 2019.
remote:
remote: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new
remote: primary implementation: https://sass-lang.com/install
remote:
remote: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the
remote: sassc gem: https://github.com/sass/sassc-ruby#readme
remote:
remote: * For more details, please refer to the Sass blog:
remote: http://sass.logdown.com/posts/7081811
remote:
remote: Bundle completed (52.01s)
remote: Cleaning up the bundler cache.
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: The latest bundler is 1.16.5, but you are currently running 1.15.2.
remote: To update, run `gem install bundler`
remote: -----> Installing node-v8.10.0-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: Yarn executable was not detected in the system.
remote: Download Yarn at https://yarnpkg.com/en/docs/install
remote: rake aborted!
remote: Uglifier::Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/uglifier-4.1.18/lib/uglifier.rb:234:in `parse_result'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/uglifier-4.1.18/lib/uglifier.rb:216:in `run_uglifyjs'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/uglifier-4.1.18/lib/uglifier.rb:168:in `compile'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:53:in `call'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/uglifier_compressor.rb:28:in `call'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:142:in `block in find'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `each'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `stat_directory'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:227:in `stat_tree'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `each'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `block in logical_paths'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `each'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `logical_paths'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:140:in `find'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote: /tmp/build_bc2e4864ab5a1aeebc622dd549e5990e/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to secure-citadel-87684.
remote:
To https://git.heroku.com/secure-citadel-87684.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/secure-citadel-87684.git'
試したこと
Qiitaの https://qiita.com/pokohide/items/017afa5be3b7dc200a8d の記事に書いてあるなど試しました。
しかし、良い結果にならず困っています。
sqlite3を開発環境のみにするなどは行っています。
補足情報(FW/ツールのバージョンなど)
Rails 5.1.2
解決方法などご存じの方いらっしゃれば、よろしくお願いいたします。
rails new して諦める道も検討しています。
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
checkベストアンサー
0
Uglifier::Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true).
原因も解決方法もここにある通りだと思うのですが、確認されましたか?
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.36%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
2018/09/21 22:35