Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"git push heroku master" Precompiling assets failed

When I run the command "git push heroku master", I get the following problem:

remote: rake aborted!

remote: JSON::GeneratorError: source sequence is illegal/malformed utf-8

remote:        Bundle complete! 17 Gemfile dependencies, 57 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 rdoc:
remote:        Depending on your version of ruby, you may need to install ruby rdoc/ri data:
remote:        <= 1.8.6 : unsupported
remote:        = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote:        = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote:        >= 1.9.2 : nothing to do! Yay!
remote:        Bundle completed (74.07s)
remote:        Cleaning up the bundler cache.
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        I, [2015-05-29T10:36:23.555507 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/Simple-Line-Icons.dev-ffb21c774358fd64880026a50cba77d9d78ae97ee7a2159242e3f481b0056b56.svg
remote:        I, [2015-05-29T10:36:23.558727 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/Simple-Line-Icons-5ff14e28be3a5e0841d37b9a2685f64dc2c0d10ca242ff0a91707424e495107a.eot
remote:        I, [2015-05-29T10:36:23.562643 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/Simple-Line-Icons-293d041046ae36a631b58b1ed36ec9ed935bcf74ed98adf07545eb8d54a33322.svg
remote:        I, [2015-05-29T10:36:23.565763 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/Simple-Line-Icons-f6f562666a73dd0b908ca0a1b522473a5b4f1bc25caa3aa9be09c9f114abdfa2.ttf
remote:        I, [2015-05-29T10:36:23.568788 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/Simple-Line-Icons-357af00e9f4081d40ba58b92be04ca240a1ce6dee7f8b83461f0922a56e8c4b7.woff
remote:        I, [2015-05-29T10:36:23.572795 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/font-icons-cdcded26f84964e5f40afd14614c0ead465021b367d0f4a9b179472e58f224ad.eot
remote:        I, [2015-05-29T10:36:23.580720 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/font-icons-c0c700e939d41bc62f3816dcf17797d6929b9f647d972f5aabcb40ec3b1b5350.svg
remote:        I, [2015-05-29T10:36:23.651012 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/font-icons-c834c60ba0ab8b6ea25860362c219fa1d649d87f6f24c5268b2c875d8e3db0ca.ttf
remote:        I, [2015-05-29T10:36:23.655396 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/font-icons-13de66596d19798ffdcad167e0913ab7afddc5ad944f669242dbeb87814843d4.woff
remote:        I, [2015-05-29T10:36:23.658156 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/lined-icons-3d6830879ddd9434dab3637a01a18b4fdf5ea7f5185278f1a22121d6b865fcdf.eot
remote:        I, [2015-05-29T10:36:23.661791 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/lined-icons-e7d393d0eba42eb7ba2a7727511819bb5d13b0fd1e5b23a7a58f6330a41871aa.svg
remote:        I, [2015-05-29T10:36:23.664512 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/lined-icons-942ece7a8a82dc533ae625d866a3ac2c2c4e89e52d6e5fc572c78a339c50085a.ttf
remote:        I, [2015-05-29T10:36:23.667328 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/lined-icons-95579100806e9a941176021ef36fd75d3183a7bd69a61d26fd9209283d36e6aa.woff
remote:        I, [2015-05-29T10:36:23.670026 #1050]  INFO -- : Writing /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/public/assets/1-8f540069818812338146ca8b1f259e6d2ec9400116e39a61dcd510fce3225bbb.jpg
remote:        rake aborted!
remote:        JSON::GeneratorError: source sequence is illegal/malformed utf-8
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/json-1.8.2/lib/json/common.rb:223:in `generate'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/json-1.8.2/lib/json/common.rb:223:in `generate'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/execjs-2.5.2/lib/execjs/external_runtime.rb:46:in `call'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/uglifier-2.7.1/lib/uglifier.rb:212:in `run_uglifyjs'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/uglifier-2.7.1/lib/uglifier.rb:179:in `compile'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/uglifier_compressor.rb:52:in `call'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/uglifier_compressor.rb:28:in `call'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/loader.rb:86:in `load_asset_by_uri'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/loader.rb:45:in `block in load'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/loader.rb:156:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/loader.rb:38:in `load'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/cached_environment.rb:47:in `yield'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/base.rb:63:in `find_asset'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/base.rb:70:in `find_all_linked_assets'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/manifest.rb:138:in `block in find'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:223:in `block in stat_tree'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:207:in `block in stat_directory'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:204:in `each'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:204:in `stat_directory'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/path_utils.rb:222:in `stat_tree'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:105:in `each'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:104:in `each'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/legacy.rb:104:in `logical_paths'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/manifest.rb:136:in `find'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/sprockets/manifest.rb:162:in `compile'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.3.1/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-3.1.0/lib/rake/sprocketstask.rb:147:in `with_logger'
remote:        /tmp/build_0e9bcbe68f03071d72bbe07e0632d1f2/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.3.1/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
remote:        Tasks: TOP => assets:precompile
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote: 
remote:  !     Push rejected, failed to compile Ruby app
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to limitless-everglades-3353.
remote: 
To https://git.heroku.com/limitless-everglades-3353.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/limitless-everglades-3353.git'

Gemfile

source 'https://rubygems.org'

gem 'rails', '4.2.0'
gem 'pg'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'devise'
gem "watu_table_builder", :require => "table_builder"
gem 'momentjs-rails', '>= 2.9.0'
gem 'bootstrap3-datetimepicker-rails', '~> 4.7.14'
gem 'russian', '~> 0.6.0'

group :development, :test do
  gem 'byebug'
  gem 'web-console', '~> 2.0'
  gem 'spring'
end

gem 'rails_12factor', group: :production
ruby "2.1.5"

How to fix it?

like image 335
yak_ilnur Avatar asked Sep 27 '22 19:09

yak_ilnur


1 Answers

I had this problem and I couldn't quite figure it out. I think that there is a bad character somewhere in my javascript but I am unable to find it. I got around it, for now, by disabling the uglifier by commenting this line out in the production.rb:

# config.assets.js_compressor = :uglifier

like image 176
paf0 Avatar answered Oct 05 '22 05:10

paf0