我查找了标题中的错误,但在这里或其他地方都找不到能回答我问题的内容。我不是ruby程序员,所以我认为处理存在问题的ruby文件不是明智的。
运行jazzy时出现错误,编译器输出指向sourcekitten.rb。如何找出哪个文件具有无效的序列/参数?在StackOverflow的其他地方,我找到了替换无效序列的建议:
string.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
,然后我可以尝试打印语句,以尝试弄清楚该创可贴在哪里应用(不是我的第一选择)。但是我不知道它是我的.swift文件之一,还是它是导致错误的中间文件或流。
/Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/sourcekitten.rb:30:in gsub': invalid byte sequence in UTF-8 (ArgumentError) from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/sourcekitten.rb:30:in autolink_block'
from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/sourcekitten.rb:733:in autolink_text' from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/sourcekitten.rb:797:in autolink_document'
from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:211:in render' from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:224:in document_markdown'
from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:400:in document' from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:90:in block (2 levels) in build_docs'
from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:89:in open' from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:89:in open'
from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:89:in block in build_docs' from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:100:in block in each_doc'
from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:96:in each' from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:96:in each_doc'
from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:85:in build_docs' from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:120:in build_site'
from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:156:in build_docs_for_sourcekitten_output' from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/lib/jazzy/doc_builder.rb:76:in build'
from /Users/Alex/.rvm/gems/ruby-2.3.3/gems/jazzy-0.9.6/bin/jazzy:15:in <top (required)>' from /Users/Alex/.rvm/gems/ruby-2.3.3/bin/jazzy:22:in load'
from /Users/Alex/.rvm/gems/ruby-2.3.3/bin/jazzy:22:in <main>' from /Users/Alex/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:24:in eval'
from /Users/Alex/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:24:in `
我正在运行Mojave(10.4.4),它是红宝石2.3.3和Jazzy 0.9.6
如何添加调试信息?它只有大约40个快速文件,因此甚至可以使用手动方法。有关寻找内容的任何提示将不胜感激。