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

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

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

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

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

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

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Q&A

解決済

1回答

2331閲覧

Heroku:push時のエラー「Precompiling assets failed. 」の対処方法

gnx_vw903

総合スコア74

Ruby on Rails 5

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

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

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

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

0グッド

1クリップ

投稿2018/12/27 04:17

お世話になっております。

Herokuにpushする際に以下のエラーが起こってしまいます。

Precompiling assets failed.

「$ mpm install yarn -gコマンド」
(参照:https://remonote.jp/heroku-assets-precompile-npm-yarn
https://logicoffee.hatenablog.com/entry/2018/09/04/160555)
など試したのですがうまくいきません。

アドバイスいただけますでしょうか?
よろしくお願いいたします。

以下がメッセージの全文になります。

vagrant@ubuntu-xenial:~/workspace/twitter$ gem install bundler Successfully installed bundler-1.17.2 Parsing documentation for bundler-1.17.2 Done installing documentation for bundler after 15 seconds 1 gem installed vagrant@ubuntu-xenial:~/workspace/twitter$ git push heroku master Counting objects: 104, done. Delta compression using up to 2 threads. Compressing objects: 100% (91/91), done. Writing objects: 100% (104/104), 23.79 KiB | 0 bytes/s, done. Total 104 (delta 8), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. remote: Detected buildpacks: Ruby,Node.js remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order remote: -----> Ruby app detected remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.4.5 remote: -----> Installing dependencies using bundler 1.15.2 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.17.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. remote: Fetching gem metadata from https://rubygems.org/......... remote: Fetching version metadata from https://rubygems.org/.. remote: Fetching dependency metadata from https://rubygems.org/. remote: Fetching rake 12.3.2 remote: Fetching concurrent-ruby 1.1.4 ... remote: Fetching sass-rails 5.0.7 remote: Installing coffee-rails 4.2.2 remote: Installing rails 5.1.6.1 remote: Installing sass-rails 5.0.7 remote: Bundle complete! 17 Gemfile dependencies, 56 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 i18n: remote: remote: HEADS UP! i18n 1.1 changed fallbacks to exclude default locale. remote: But that may break your application. remote: remote: Please check your Rails app for 'config.i18n.fallbacks = true'. remote: If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this shouldbe remote: 'config.i18n.fallbacks = [I18n.default_locale]'. remote: If not, fallbacks will be broken in your app by I18n 1.1.x. remote: remote: For more info see: remote: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0 remote: 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 (36.72s) remote: Cleaning up the bundler cache. 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: Sprockets::FileNotFound: couldn't find file 'jquery/dist/jquery.js' with type 'application/javascript' remote: Checked in these paths: remote: /tmp/build_611e84c7cd690d882045e683130c52ab/app/assets/config remote: /tmp/build_611e84c7cd690d882045e683130c52ab/app/assets/images remote: /tmp/build_611e84c7cd690d882045e683130c52ab/app/assets/javascripts remote: ... /tmp/build_611e84c7cd690d882045e683130c52ab/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define' remote: /tmp/build_611e84c7cd690d882045e683130c52ab/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger' remote: /tmp/build_611e84c7cd690d882045e683130c52ab/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define' remote: /tmp/build_611e84c7cd690d882045e683130c52ab/vendor/bundle/ruby/2.4.0/gems/rake-12.3.2/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 agile-sierra-25491. remote: To https://git.heroku.com/agile-sierra-25491.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/agile-sierra-25491.git'

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

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

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

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

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

guest

回答1

0

ベストアンサー

ターミナルで
$ heroku buildpacks:set heroku/ruby
$ heroku buildpacks:add --index 1 heroku/nodejs

上記2つを実行してみてはいかがでしょうか?

投稿2018/12/27 09:07

Malas

総合スコア112

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

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

gnx_vw903

2018/12/27 10:18

ご返信ありがとうございます。 以前としてエラーが出ています。 ただエラーが以下に変わりました。 ``` remote: Tasks: TOP => assets:precompile remote: (See full trace by running task with --trace) remote: zlib(finalizer): Zlib::GzipWriter object must be closed explicitly. remote: zlib(finalizer): the stream was freed prematurely. remote: remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. ``` ``` remote: zlib(finalizer): Zlib::GzipWriter object must be closed explicitly. remote: zlib(finalizer): the stream was freed prematurely. ``` ここが今までと違うエラーになっています。 よろしくお願いいたします。
Malas

2018/12/27 10:55

そうでしたか。すみません。 ターミナルでheroku run rake db:migrate RAILS_ENV=productionを実行するとどうなりますか?
gnx_vw903

2018/12/27 11:19

いえいえアドバイスいただきありがとうございます。 以下が実行結果です。 ``` vagrant@ubuntu-xenial:~/workspace/twitter$ heroku run rake db:migrate RAILS_ENV=production Running rake db:migrate RAILS_ENV=production on ⬢ agile-sierra-25491... up, run.5226 (Free) rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) (See full trace by running task with --trace) ``` Rakefileがないことが原因ですかね…
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問