yardoc - can't view code docs in browser

J

Jeff W.

I'm using yardoc to document my ruby code. I do have all of my
documentation generated and in the doc directory of my project, when I
type "yard server" WEBrick fires up. But when I go to the actual web
page at port 8808 none of my docs are there. It's just showing an empty
yardoc HTML template. It does say "Documentation for MyProject" however.
What could be happening?

A strange thing is that it worked perfectly fine (a nice documentation
tool, btw) when I did a test run with a very small set of .rb files.
Then I generated the docs for the whole project (took 3 hours) and now
I'm getting nothing.
 
J

Jeff W.

Update: I've figured out I needed to remove the .yardoc directory and
then fire up the server again. At that point yard has to parse the
source again, create another .yardoc directory and then WEBrick will
start running. Now I have some of the documented code showing in the
resulting web page. The problem now is that it is only parsing data in
the lib directory, and not any of the many other directories I have ruby
code.
According to the documentation for yardoc, one has to specify on the
command line all of those directories you want yardoc to look in and
parse, which is in fact what I did when I actually documented
everything. That's why I do have everything documented. But now whenever
I remove .yardoc and start up the server and the .yardoc directory is
recreated it only shows .rb files from lib. What is that about?
 
J

Jeff W.

Update: OK, I've specified what paths to parse in the .yardopts file
since YARD only shows documentation from the lib directory by default
unless you specify the paths you want.

Now the page is showing Internal Server Error and I'm getting this
from WEBrick:

ERROR NoMethodError: undefined method `root?' for nil:NilClass
~/.gem/ruby/1.8/gems/yard-0.6.3/lib/yard/code_objects/base.rb:391:in
`path'
 
R

Ryan Davis

Update: OK, I've specified what paths to parse in the .yardopts file=20=
since YARD only shows documentation from the lib directory by default=20=
unless you specify the paths you want.
=20
Now the page is showing Internal Server Error and I'm getting this
from WEBrick:
=20
ERROR NoMethodError: undefined method `root?' for nil:NilClass
~/.gem/ruby/1.8/gems/yard-0.6.3/lib/yard/code_objects/base.rb:391:in
`path'

This looks like a bug to me. You'd be better off (and contribute more =
back) if you filed a ticket on their bug tracker.
 
M

Mr. Bill

SOLUTION: I installed the bluecloth and rack gems. Also, the issue may
have been related to how the project handled gems. So I started
controlling the gems through Bundler (http://gembundler.com). Doing all
of this resolved the issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top