undefined method `source_type` for nil:NilClass

's Avatar

paddor

06 Dec, 2015 12:29 AM

I just tried to add my project from github (paddor/cztop). When I access [2], I get the error below. On my local machine with YARD 0.8.7.6 it runs just fine.

Thanks.

[1] https://github.com/paddor/cztop [2] http://www.rubydoc.info/github/paddor/cztop/master

undefined method `source_type' for nil:NilClass
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/helpers/html_helper.rb:590:in `block in parse_codeblocks'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/helpers/html_helper.rb:586:in `gsub'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/helpers/html_helper.rb:586:in `parse_codeblocks'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/helpers/html_helper.rb:48:in `htmlify'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/yard-sd-0.0.4/lib/yard-sd/sequence_diagram_mixin.rb:5:in `htmlify'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/templates/default/layout/html/setup.rb:65:in `diskfile'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:355:in `render_section'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:251:in `block (2 levels) in run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:248:in `each'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:248:in `block in run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:386:in `add_options'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:247:in `run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:269:in `block in yieldall'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:400:in `with_section'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:269:in `yieldall'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/templates/default/layout/html/layout.erb:23:in `_erb_cache_0'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:279:in `erb'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/templates/default/layout/html/setup.rb:60:in `layout'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:355:in `render_section'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:251:in `block (2 levels) in run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:248:in `each'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:248:in `block in run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:386:in `add_options'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:247:in `run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/template.rb:135:in `run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/templates/engine.rb:88:in `render'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/commands/base.rb:143:in `render'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/commands/display_file_command.rb:23:in `run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/commands/base.rb:95:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/commands/library_command.rb:65:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/commands/display_object_command.rb:16:in `run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/commands/base.rb:95:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/commands/library_command.rb:65:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/router.rb:135:in `route_docs'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/router.rb:110:in `route'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/router.rb:54:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/bundler/gems/yard-13d9939df94a/lib/yard/server/rack_adapter.rb:51:in `call'
/home/app/rubydoc.info/app.rb:367:in `block in <class:DocServer>'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1540:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1540:in `block in compile!'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:950:in `[]'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:950:in `block (3 levels) in route!'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:966:in `route_eval'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:950:in `block (2 levels) in route!'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:987:in `block in process_route'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:985:in `catch'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:985:in `process_route'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:948:in `block in route!'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:947:in `each'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:947:in `route!'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1059:in `block in dispatch!'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `block in invoke'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `catch'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `invoke'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1056:in `dispatch!'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:882:in `block in call!'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `block in invoke'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `catch'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `invoke'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:882:in `call!'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:870:in `call'
/home/app/rubydoc.info/app.rb:28:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.0/lib/rack/protection/xss_header.rb:18:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.0/lib/rack/protection/path_traversal.rb:16:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.0/lib/rack/protection/json_csrf.rb:18:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.0/lib/rack/protection/frame_options.rb:31:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/logger.rb:15:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/puma-2.8.1/lib/puma/rack_patch.rb:13:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:212:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:205:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:175:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1949:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1449:in `block in call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1724:in `synchronize'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1724:in `synchronize'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:1449:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/puma-2.8.1/lib/puma/configuration.rb:71:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/puma-2.8.1/lib/puma/server.rb:490:in `handle_request'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/puma-2.8.1/lib/puma/server.rb:361:in `process_client'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/puma-2.8.1/lib/puma/server.rb:254:in `block in run'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/puma-2.8.1/lib/puma/thread_pool.rb:92:in `call'
/home/app/rubydoc.info/vendor/bundle/ruby/2.1.0/gems/puma-2.8.1/lib/puma/thread_pool.rb:92:in `block in spawn_thread'
  1. Support Staff 1 Posted by lsegal on 06 Dec, 2015 12:42 AM

    lsegal's Avatar

    I believe it's your use of --use-cache that is breaking parsing on our servers, since we don't use this same cache file. You should typically not put cache related things inside your .yardopts file, since that will break plenty of stuff across different environments.

  2. 2 Posted by Patrik Wenger on 06 Dec, 2015 09:48 PM

    Patrik Wenger's Avatar

    Thanks for your response. True, it works without that option. How would one know which options to put in a .yardopts file and which ones better not?

    Strangely, the additional files under vendor (specified in my .yardopts file as ---private lib/**/*.rb vendor/czmq/bindings/ruby/**/*.rb) are ignored.

  3. Support Staff 3 Posted by lsegal on 06 Dec, 2015 09:51 PM

    lsegal's Avatar

    Thanks for your response. True, it works without that option. How would one know which options to put in a .yardopts file and which ones better not?

    Anything that touches the filesystem should be ignored, as you don't have direct access to it. Evaluating code with -e is also disabled, as is --query.

    Strangely, the additional files under vendor (specified in my .yardopts file as ---private lib/**/*.rb vendor/czmq/bindings/ruby/**/*.rb) are ignored.

    This is due to your use of submodules, I imagine, which rubydoc does not support. We only clone your repository as is with a single git clone command.

  4. Support Staff 4 Posted by lsegal on 06 Dec, 2015 09:52 PM

    lsegal's Avatar

    FWIW rubydoc.info is open source, and you can run it on your local machine if you want to see what it looks like in rendering your project:

    http://github.com/docmeta/rubydoc.info

  5. lsegal closed this discussion on 10 Sep, 2016 11:07 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac