0
我想在今天早些時候將我的主博客轉換爲Octopress,所以我克隆了Octopress,並將其配置並部署到Heroku中。嘗試將Blogger文章導入Octopress/Jekyll時出錯
隨後我就如何導入我的老博客文章到Octopress網,發現這個腳本作爲它的答案:
https://gist.github.com/1578928
我導出的文件blog.xml
我。當我在要點中運行腳本時,出現以下錯誤。我剛剛開始使用Ruby,對此我不太瞭解。如果有人能幫助我,我會很高興。該錯誤似乎是全新的,迄今爲止我無法從我的搜索中找到任何答案。
import.rb:33:in `add': dunno ide (RuntimeError)
from import.rb:158:in `block in <main>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.2-x86-mingw32/lib/nokogiri/xml/node_set.rb:239:in `block in each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.2-x86-mingw32/lib/nokogiri/xml/node_set.rb:238:in `upto'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.2-x86-mingw32/lib/nokogiri/xml/node_set.rb:238:in `each'
from import.rb:157:in `<main>'
XML很好,我找不到任何稱爲「ide」的類型,除了在一篇文章中,我認爲這不會有任何問題。 – 2012-05-20 12:45:49
我不確定這個XML是怎麼樣的(如果你不介意發表至少一些有用的信息),但是這是腳本如何處理'type':'type = node.search('類別 ')。first.attr(' 術語 ')。分裂(' #')。last'。所以本質上它解析'category'的術語,並期望找到'post'或者'comment'來做一些有意義的事情,或者'template','settings'來默默地忽略。哦,所有這些發生在「入口」節點內。 – dain 2012-05-20 15:59:50
我有使用博主,[import.rb gist](https://gist.github.com/dnagir/1765496)腳本和八章相同的問題。 * **避免**在ruby中引發異常:'else raise'dunno'+ type' * **或**從您導出的博客XML中刪除註釋。 – 2013-02-25 19:10:22