Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yard fails with undefined method `new' for nil:NilClass #407

Closed
aslakhellesoy opened this issue Nov 3, 2011 · 7 comments
Closed

Yard fails with undefined method `new' for nil:NilClass #407

aslakhellesoy opened this issue Nov 3, 2011 · 7 comments

Comments

@aslakhellesoy
Copy link

To reproduce:

git clone git://github.com/cucumber/cucumber-rails.git
cd cucumber-rails
bundle install
rake yard

This has worked previously - not sure when it broke. Happens on both 0.7.2 and 0.7.3

@aslakhellesoy
Copy link
Author

Weird. If I change Rakefile to do require 'bundler' instead of require 'bundler/setup' it works. I suppose some monkey-patching gems are stompin on each other...

@aslakhellesoy
Copy link
Author

If I put require 'bundler/setup' back I get:

rake yard -t
** Invoke yard (first_time)
** Execute yard
[warn]: Could not load default RDoc formatter, ignoring any markup (install RDoc to get default formatting).
[warn]: in YARD::Handlers::Ruby::MethodHandler: Undocumentable method defined on object instance
[warn]:     in file 'lib/cucumber/rails/application.rb':12:

    12: def ad.show_exceptions

rake aborted!
undefined method `new' for nil:NilClass
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/helpers/html_helper.rb:89:in `html_markup_rdoc'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/helpers/html_helper.rb:41:in `htmlify'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/templates/default/layout/html/setup.rb:49:in `diskfile'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:314:in `render_section'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:210:in `block (2 levels) in run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:207:in `each'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:207:in `block in run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:345:in `add_options'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:206:in `run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:228:in `block in yieldall'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:359:in `with_section'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:228:in `yieldall'
/Users/ahellesoy/scm/cucumber-rails/dev_tasks/yard/default/layout/html/layout.erb:23:in `_erb_cache_5'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:238:in `erb'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:316:in `render_section'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:210:in `block (2 levels) in run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:207:in `each'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:207:in `block in run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:345:in `add_options'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:206:in `run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:91:in `run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/templates/default/fulldoc/html/setup.rb:72:in `block in serialize_file'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/engine.rb:115:in `with_serializer'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/templates/default/fulldoc/html/setup.rb:71:in `serialize_file'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/templates/default/fulldoc/html/setup.rb:10:in `block in init'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/templates/default/fulldoc/html/setup.rb:9:in `each'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/templates/default/fulldoc/html/setup.rb:9:in `each_with_index'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/templates/default/fulldoc/html/setup.rb:9:in `init'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:144:in `initialize'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:86:in `new'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/template.rb:91:in `run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/templates/engine.rb:103:in `generate'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/cli/yardoc.rb:306:in `run_generate'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/cli/yardoc.rb:219:in `run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/yard-0.7.3/lib/yard/rake/yardoc_task.rb:65:in `block in define'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/ahellesoy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/bin/rake:19:in `load'
/Users/ahellesoy/.rvm/gems/ruby-1.9.3-p0@cucumber/bin/rake:19:in `<main>'
Tasks: TOP => yard

@aslakhellesoy
Copy link
Author

FWIW, bundle exec rake yard also fails

@lsegal
Copy link
Owner

lsegal commented Nov 4, 2011

bundle exec yard works, however, at least for me. I assume there is something in require 'bundler/setup' that is breaking the way YARD loads rdoc. I will verify whether this is YARD's fault or not

lsegal added a commit that referenced this issue Nov 4, 2011
@lsegal
Copy link
Owner

lsegal commented Nov 4, 2011

Closed by the above commit. Should solve this issue. A temporary workaround would be to require 'rdoc' in your Rakefile after bundler/setup

@lsegal lsegal closed this as completed Nov 4, 2011
@cmeiklejohn
Copy link

I'm experiencing this regardless if I have require 'bundler' or require 'bundler/setup'

@cmeiklejohn
Copy link

Ah, inside of my gemspec I needed to explicitly require rdiscount as a dependency, which resolved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants