rails guides:generate failed (possible related with nokogiri parsing dom)

Hello everyone,

I am starting to work on Rails Guides Translation. I create a source/zh-TW folder and put the markdowns there. Then I translate an article and tried to generate the html but got failed. I tried to trace what happens but did not have a clue. Could anyone look at this and give me some advices?

The error log is:

    $ rake guides:generate GUIDES_LANGUAGE=zh-TW ALL=1
/Users/Mac/.rvm/rubies/ruby-2.1.1/bin/ruby rails_guides.rb
Generating 2_2_release_notes.md as 2_2_release_notes.html
Generating 2_3_release_notes.md as 2_3_release_notes.html
Generating 3_0_release_notes.md as 3_0_release_notes.html
Generating 3_1_release_notes.md as 3_1_release_notes.html
Generating 3_2_release_notes.md as 3_2_release_notes.html
Generating 4_0_release_notes.md as 4_0_release_notes.html
Generating 4_1_release_notes.md as 4_1_release_notes.html
/Users/Mac/docs/rails-guides-translation/rails_guides/markdown.rb:42:in `dom_id': undefined method `[]' for nil:NilClass (NoMethodError)
from /Users/Mac/docs/rails-guides-translation/rails_guides/markdown.rb:100:in `block (2 levels) in generate_structure'
from /Users/Mac/.rvm/gems/ruby-2.1.1@empty/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:237:in `block in each'
from /Users/Mac/.rvm/gems/ruby-2.1.1@empty/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:236:in `upto'
from /Users/Mac/.rvm/gems/ruby-2.1.1@empty/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:236:in `each'
from /Users/Mac/docs/rails-guides-translation/rails_guides/markdown.rb:85:in `block in generate_structure'
from /Users/Mac/docs/rails-guides-translation/rails_guides/markdown.rb:82:in `tap'
from /Users/Mac/docs/rails-guides-translation/rails_guides/markdown.rb:82:in `generate_structure'
from /Users/Mac/docs/rails-guides-translation/rails_guides/markdown.rb:23:in `render'
from /Users/Mac/docs/rails-guides-translation/rails_guides/generator.rb:205:in `block in generate_guide'
from /Users/Mac/docs/rails-guides-translation/rails_guides/generator.rb:195:in `open'
from /Users/Mac/docs/rails-guides-translation/rails_guides/generator.rb:195:in `generate_guide'
from /Users/Mac/docs/rails-guides-translation/rails_guides/generator.rb:144:in `block in generate_guides'
from /Users/Mac/docs/rails-guides-translation/rails_guides/generator.rb:142:in `each'
from /Users/Mac/docs/rails-guides-translation/rails_guides/generator.rb:142:in `generate_guides'
from /Users/Mac/docs/rails-guides-translation/rails_guides/generator.rb:97:in `generate'
from rails_guides.rb:63:in `<main>'
rake aborted!
Command failed with status (1): [/Users/Mac/.rvm/rubies/ruby-2.1.1/bin/ruby...]
/Users/Mac/docs/rails-guides-translation/Rakefile:11:in `block (3 levels) in <top (required)>'
/Users/Mac/.rvm/gems/ruby-2.1.1@empty/bin/ruby_executable_hooks:15:in `eval'
/Users/Mac/.rvm/gems/ruby-2.1.1@empty/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => guides:generate => guides:generate:html
(See full trace by running task with --trace)

I made a Pull Request to show this situation: https://github.com/docsrails-tw/guides/pull/2

Any help would be appreciate, thank you.

Could you please send me a tarball with the zh-TW sources to try to
reproduce?