問題を解決するために何時間も検索しました。私はこれを解決することができないようです。JSON :: GeneratorErrorのため、Capistranoを使用してDigital Ocean VPSにデプロイできませんでした。ソースシーケンスが不正/不正な形式です。utf-8
*cap production deploy * throws the following error as shown in the log. This solution doesn't help.
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: rake exit status: 1
rake stdout: rake aborted!
JSON::GeneratorError: source sequence is illegal/malformed utf-8
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/json-1.8.3/lib/json/common.rb:223:in `generate'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/json-1.8.3/lib/json/common.rb:223:in `generate'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:46:in `call'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/uglifier-2.7.2/lib/uglifier.rb:212:in `run_uglifyjs'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/uglifier-2.7.2/lib/uglifier.rb:179:in `compile'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/uglifier_compressor.rb:52:in `call'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/uglifier_compressor.rb:28:in `call'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:60:in `block in load'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:44:in `load'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:in `yield'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:in `load'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/base.rb:66:in `find_asset'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:138:in `block in find'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:223:in `block in stat_tree'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:207:in `block in stat_directory'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:204:in `each'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:204:in `stat_directory'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:222:in `stat_tree'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:105:in `each'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:104:in `each'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:104:in `logical_paths'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:136:in `find'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:162:in `compile'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/rake/sprocketstask.rb:147:in `with_logger'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
rake stderr: Nothing written
[1]: https://stackoverflow.com/questions/31372478/rake-aborted-jsongeneratorerror-source-sequence-is-illegal-malformed-utf-8-a
私は辛抱強くJSファイルがコンパイルされているの一つは、無効なUTF-8バイトを含む溶液に
bundle exec take assetsを実行すると、同じエラーが発生しますか?ローカルでプリコンパイルしますか? –
@will_in_wi 'bundle exec rake assets:プリコンパイルRAILS_ENV = production'をローカルに呼び出すと、同じエラーが発生します。タイムリーな応答のために 'bundle exec rake assets:プリコンパイルRAILS_ENV = development'をローカルに呼び出さないでください。 – Esseme