Comparison of String with :current_path failed

Hello,

i become update for Ruby to version 2.3.1 and now something with middleman want not work. It create no index.html anymore. I become with --verbose ever the same error. The page is upload to github repo > https://github.com/sisihagen/webroot

It were nice someone have an idea what is wrong now. More information, feel free to ask.

Thank you
Silvio

== Request: /blog/page/2/index.html
error dest/silviosiefke.de/htdocs/blog/page/2/index.html
comparison of String with :current_path failed
/home/siefke/.gem/ruby/2.3.0/gems/tilt-2.0.5/lib/tilt/template.rb:162:in sort!' /home/siefke/.gem/ruby/2.3.0/gems/tilt-2.0.5/lib/tilt/template.rb:162:in evaluate’
/home/siefke/.gem/ruby/2.3.0/gems/tilt-2.0.5/lib/tilt/template.rb:102:in render' /home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/file_renderer.rb:79:in render’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_reference.rb:43:in send_to' /home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/call_with.rb:76:in call_with’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138:in block in redefine_method' /home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/template_renderer.rb:184:in _render_with_all_renderers’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/template_renderer.rb:147:in block in render' /home/siefke/.gem/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in instrument’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/util.rb:21:in instrument' /home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/template_renderer.rb:146:in render’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_reference.rb:43:in send_to' /home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/call_with.rb:76:in call_with’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138:in block in redefine_method' /home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/sitemap/resource.rb:154:in render’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_reference.rb:43:in send_to' /home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/call_with.rb:76:in call_with’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138:in block in redefine_method' /home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/rack.rb:112:in process_request’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/rack.rb:66:in block in call' /home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/rack.rb:65:in catch’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/rack.rb:65:in call' /home/siefke/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/urlmap.rb:68:in block in call’
/home/siefke/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/urlmap.rb:53:in each' /home/siefke/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/urlmap.rb:53:in call’
/home/siefke/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/head.rb:12:in call' /home/siefke/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/lint.rb:49:in _call’
/home/siefke/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/lint.rb:37:in call' /home/siefke/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:153:in call’
/home/siefke/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/mock.rb:74:in request' /home/siefke/.gem/ruby/2.3.0/gems/rack-2.0.1/lib/rack/mock.rb:56:in get’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/builder.rb:230:in block in output_resource' /home/siefke/.gem/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in instrument’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/util.rb:21:in instrument' /home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/builder.rb:223:in output_resource’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_reference.rb:43:in send_to' /home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/call_with.rb:76:in call_with’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138:in block in redefine_method' /home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:451:in call_with_index’
/home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:422:in process_incoming_jobs' /home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:404:in block in worker’
/home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:395:in fork' /home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:395:in worker’
/home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:386:in block in create_workers' /home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:385:in each’
/home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:385:in each_with_index' /home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:385:in create_workers’
/home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:327:in work_in_processes' /home/siefke/.gem/ruby/2.3.0/gems/parallel-1.9.0/lib/parallel.rb:241:in map’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/builder.rb:135:in output_resources' /home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_reference.rb:43:in send_to’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/call_with.rb:76:in call_with' /home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138:in block in redefine_method’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/builder.rb:129:in output_files' /home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_reference.rb:43:in send_to’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/call_with.rb:76:in call_with' /home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138:in block in redefine_method’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/builder.rb:71:in block in run!' /home/siefke/.gem/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in instrument’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/util.rb:21:in instrument' /home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/builder.rb:70:in run!’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_reference.rb:43:in send_to' /home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/call_with.rb:76:in call_with’
/home/siefke/.gem/ruby/2.3.0/gems/contracts-0.13.0/lib/contracts/method_handler.rb:138:in block in redefine_method' /home/siefke/.gem/ruby/2.3.0/gems/middleman-cli-4.1.11/lib/middleman-cli/build.rb:80:in block in build’
/home/siefke/.gem/ruby/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in instrument' /home/siefke/.gem/ruby/2.3.0/gems/middleman-core-4.1.11/lib/middleman-core/util.rb:21:in instrument’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-cli-4.1.11/lib/middleman-cli/build.rb:79:in build' /home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run’
/home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' /home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in block in invoke_all’
/home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in each' /home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in map’
/home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in invoke_all' /home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/group.rb:232:in dispatch’
/home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:115:in invoke' /home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor.rb:40:in block in register’
/home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' /home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command’
/home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' /home/siefke/.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in start’
/home/siefke/.gem/ruby/2.3.0/gems/middleman-cli-4.1.11/bin/middleman:72:in <top (required)>' /home/siefke/.gem/ruby/2.3.0/bin/middleman:22:in load’
/home/siefke/.gem/ruby/2.3.0/bin/middleman:22:in `’

I was just facing this very thing. Try this in your config.rb:

Tilt::SYMBOL_ARRAY_SORTABLE = false

worked for me. (You’ll get warnings that you’re redefining a constant.)

Apparently, tilt thinks you can sort intermixed arrays of strings and symbols without conversion in versions of ruby >= 1.9:

SYMBOL_ARRAY_SORTABLE = RUBY_VERSION >= '1.9'
# [other stuff omitted]
      if SYMBOL_ARRAY_SORTABLE
        locals_keys.sort!
      else
        locals_keys.sort!{|x, y| x.to_s <=> y.to_s}
      end

I’m not sure where they come by that idea.

$ ruby -v                                                     !168
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
$ irb                                                         !169
irb(main):001:0>  [:x,"y"].sort                                                                           
ArgumentError: comparison of Symbol with String failed
        from (irb):1:in `sort'
        from (irb):1
        from /home/zed/.rbenv/versions/2.3.1/bin/irb:11:in `<main>'
irb(main):002:0> 
1 Like

Hello,

thank you so much. I was so crazy I think ruby is crashed, I install the complete system new. Uff, is really nice when understand the progrramming. Thank you so much.

Silvio