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

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

新規登録して質問してみよう
ただいま回答率
85.48%
Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

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

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

Q&A

0回答

627閲覧

Heroku Precompiling assets failed. が解決できない

eru_desu

総合スコア2

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

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

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

0グッド

0クリップ

投稿2020/10/26 21:28

編集2020/10/27 23:39

やりたいこと

rails アプリをherokuでデプロイしたい
##エラー
error: failed to push some refs to 'https://git.heroku.com/cryptic-everglades-97405.git'
でデプロイされない

ターミナル Uglifier::Error: Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true). 省略 remote: 2299 remote: 2300 remote: 2301 remote: 2302 remote: => const nav = document.getElementsByClassName("nav-js")[0]; remote: 2304 const button = document.getElementsByClassName("js-nav-button")[0]; remote: 2305 remote: 2306 button.addEventListener("click", () => { remote: 2307 nav.classList.toggle("active"); remote: 2308 remote: 2309 if (nav.classList.contains("active")) { remote: 2310 button.classList.add("active"); remote: 2311 } else { remote: == 省略 remote: ! remote: ! Precompiling assets failed. remote: ! 省略 To https://git.heroku.com/cryptic-everglades-97405.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/cryptic-everglades-97405.git'

=> const nav = document.getElementsByClassName("nav-js")[0];
が赤くなっている

application.js // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's // vendor/assets/javascripts directory can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. JavaScript code in this file should be added after the last require_* statement. // // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // //= require rails-ujs //= require activestorage //= require_tree . const nav = document.getElementsByClassName("nav-js")[0]; const button = document.getElementsByClassName("js-nav-button")[0]; button.addEventListener("click", () => { nav.classList.toggle("active"); if (nav.classList.contains("active")) { button.classList.add("active"); } else { button.classList.remove("active"); } });
config/environments/production.rb config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress JavaScripts and CSS. config.assets.js_compressor = Uglifier.new(harmony: true) # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = true

## 試したこと
Uglifier.new(harmony: true)と記述したが、エラーが発生し、なにが間違っているのかがわからない

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

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

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

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

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

winterboum

2020/10/26 23:08

javascriptのタグを追加したほうが良いでしょう
eru_desu

2020/10/27 14:29

どういうことでしょうか?
winterboum

2020/10/27 21:09

エラーがRails/Rubyでなくjavascriptでおきてますから、JSの判る人の目に着くようにするためです
eru_desu

2020/10/27 23:07

わかりました! 丁寧にありがとうございます!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問