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

HTTP 404 when accessing nested pages in system docs via WEBrick #615

Closed
scottmacpherson opened this issue Mar 27, 2018 · 1 comment · Fixed by #708
Closed

HTTP 404 when accessing nested pages in system docs via WEBrick #615

scottmacpherson opened this issue Mar 27, 2018 · 1 comment · Fixed by #708

Comments

@scottmacpherson
Copy link

I'm struggling to get ri --server working properly with the Ruby core documentation on any of my installations. I've tried ruby-doc packages on fresh installations of Debian and Ubuntu with similar results, so I'm moderately confident the issue is global.

All the system documentation seems to be installed fine: ri ruby: lists all the right pages, and something like ri ruby:syntax/methods works a treat in a terminal.

When I fire up ri --server though, and navigate to the "Ruby Documentation" → "methods" page (/ruby/syntax/methods_rdoc.html), I get a 404 response. It's a similar story for any of the pages which are children of "syntax":

The page /ruby/syntax/methods_rdoc.html was not found

And in the server log when hopping from the "syntax" page (which works fine) to the "methods" page:

::1 - - [26/Mar/2018:13:50:56 AEDT] "GET /ruby/syntax_rdoc.html HTTP/1.1" 200 5886
http://localhost:8214/ruby/ -> /ruby/syntax_rdoc.html
::1 - - [26/Mar/2018:13:47:16 AEDT] "GET /ruby/syntax/methods_rdoc.html HTTP/1.1" 404 134943
http://localhost:8214/ruby/ -> /ruby/syntax/methods_rdoc.html
  • macOS 10.13.3
  • rbenv 1.1.1
  • Ruby 2.5.0
  • ri 6.0.1
$ ri --list-doc-dirs
/Users/scott/.rbenv/versions/2.5.0/share/ri/2.5.0/system
/Users/scott/.rbenv/versions/2.5.0/share/ri/2.5.0/site
/Users/scott/.rdoc
…
$ ls -Al /Users/scott/.rbenv/versions/2.5.0/share/ri/2.5.0/system
…
-rw-r--r--    1 scott  staff    1672 19 Mar 10:53 page-syntax_rdoc.ri
drwxr-xr-x   12 scott  staff     384 19 Mar 10:53 syntax
…
$ ls -Al /Users/scott/.rbenv/versions/2.5.0/share/ri/2.5.0/system/syntax/
…
-rw-r--r--  1 scott  staff  14223 19 Mar 10:53 page-assignment_rdoc.ri
-rw-r--r--  1 scott  staff  12278 19 Mar 10:53 page-calling_methods_rdoc.ri
-rw-r--r--  1 scott  staff  15803 19 Mar 10:53 page-control_expressions_rdoc.ri
-rw-r--r--  1 scott  staff   2987 19 Mar 10:53 page-exceptions_rdoc.ri
-rw-r--r--  1 scott  staff  13753 19 Mar 10:53 page-literals_rdoc.ri
-rw-r--r--  1 scott  staff  16589 19 Mar 10:53 page-methods_rdoc.ri
-rw-r--r--  1 scott  staff   4069 19 Mar 10:53 page-miscellaneous_rdoc.ri
-rw-r--r--  1 scott  staff  10422 19 Mar 10:53 page-modules_and_classes_rdoc.ri
-rw-r--r--  1 scott  staff   1568 19 Mar 10:53 page-precedence_rdoc.ri
-rw-r--r--  1 scott  staff   9292 19 Mar 10:53 page-refinements_rdoc.ri
@scottmacpherson
Copy link
Author

This seems to happen because documentation_page replaces any instances of "/" in the requested path with "::", which means the search performed by find_text_page never finds a hit.

I've confirmed that removing the gsub from line x resolves this particular issue (while obviously causing other problems).

aycabta added a commit to aycabta/rdoc that referenced this issue Jan 25, 2019
RDoc::Servlet#documentation_page replaces "/" in URL with "::" for class
or module but it's also uses the replaced name for text page. This
causes a bug when text pages are in nesting directory.

This commit fixes ruby#615.
aycabta added a commit to aycabta/rdoc that referenced this issue Mar 27, 2019
RDoc::Servlet#documentation_page replaces "/" in URL with "::" for class
or module but it also uses the replaced name for text page. This causes
a bug when text pages are in nesting directory.

This commit fixes ruby#615.
aycabta added a commit to aycabta/rdoc that referenced this issue Mar 27, 2019
RDoc::Servlet#documentation_page replaces "/" in URL with "::" for class
or module but it's also used for the replaced name on text pages. This
causes a bug when text pages are in nesting directory.

This commit fixes ruby#615.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant