square / fdoc

Documentation format and verification
Other
379 stars 59 forks source link

Mention Ruby version in Readme #59

Open vkotovv opened 10 years ago

vkotovv commented 10 years ago

We tried to run fdoc on a machine with Ruby 2.0 and it failed with the following stack trace. Then it worked with Ruby 1.8.7 installed. Maybe it should be explicitly stated that you should use Ruby < 2.0 to run fdoc.

(erb):46:in `concat': incompatible character encodings: UTF-8 and US-ASCII (Encoding::CompatibilityError)
from (erb):46:in `get_binding'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:849:in `eval'
from /System/Library/Fram
eworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:849:in `result'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/presenters/base_presenter.rb:23:in `render_erb'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/presenters/endpoint_presenter.rb:12:in `to_html'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:58:in `block (4 levels) in convert_to_html'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:57:in `each'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:57:in `block (3 levels) in convert_to_html'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:56:in `each'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:56:in `block (2 levels) in convert_to_html'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/actions.rb:184:in `block in inside'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:125:in `chdir'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:125:in `cd'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/actions.rb:184:in `inside'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:85:in `inside_service_presenter'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:53:in `block in convert_to_html'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:52:in `each'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:52:in `convert_to_html'
    from /Users/tralfamadore/Sources/fdoc/lib/fdoc/cli.rb:41:in `convert'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from fdoc/bin/fdoc:9:in `<main>'
zachmargolis commented 10 years ago

I wouldn't go as far as requiring 1.8.7, I run fdoc in 1.9.3 all the time, have not hit this issue.

Maybe we're missing some encoding comments or something. Do you have a small version of your .fdoc files that can help reproduce this error?

vkotovv commented 10 years ago

You can find small sample in this commit. I just checked, it works with Ruby 1.8.7, but is not working with 2.0.

vkotovv commented 10 years ago

Also, you can take a look at this merged pull request. Because the content of the sample is in Russian, maybe its not just a matter of changing charset for template files in Ruby >= 2.0. I'm not a Ruby expert though.