Project

General

Profile

Bug #11924

$ gem server is broken for documentation browsing

Added by Quintus (Marvin Gülker) almost 4 years ago. Updated over 3 years ago.

Status:
Third Party's Issue
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]
[ruby-core:72592]

Description

The $ gem server command is broken. The gemserver doesn’t find the stylesheets and javascripts, so that the browser only shows the unstyled, bare HTML.

Sample commandline session:

% gem list ffi

*** LOCAL GEMS ***

ffi (1.9.10)
% gem rdoc --overwrite ffi
Parsing documentation for ffi-1.9.10
Installing ri documentation for ffi-1.9.10
% gem which ffi
/home/quintus/.gem/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi.rb
% gem server
Server started at http://0.0.0.0:8808
Server started at http://[::]:8808
localhost.localdomain - - [29/Dec/2015:13:12:46 CET] "GET /doc_root/ffi-1.9.10/ HTTP/1.1" 200 14339
- -> /doc_root/ffi-1.9.10/
localhost.localdomain - - [29/Dec/2015:13:12:47 CET] "GET /doc_root/css/rdoc.css HTTP/1.1" 404 2048
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/css/rdoc.css
localhost.localdomain - - [29/Dec/2015:13:12:47 CET] "GET /doc_root/css/fonts.css HTTP/1.1" 404 2048
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/css/fonts.css
localhost.localdomain - - [29/Dec/2015:13:12:47 CET] "GET /doc_root/ffi-1.9.10/js/navigation.js HTTP/1.1" 404 14114
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/ffi-1.9.10/js/navigation.js
localhost.localdomain - - [29/Dec/2015:13:12:47 CET] "GET /doc_root/ffi-1.9.10/js/search.js HTTP/1.1" 404 14110
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/ffi-1.9.10/js/search.js
localhost.localdomain - - [29/Dec/2015:13:12:47 CET] "GET /doc_root/ffi-1.9.10/js/searcher.js HTTP/1.1" 404 14112
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/ffi-1.9.10/js/searcher.js
localhost.localdomain - - [29/Dec/2015:13:12:47 CET] "GET /doc_root/ffi-1.9.10/js/search_index.js HTTP/1.1" 200 60522
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/ffi-1.9.10/js/search_index.js
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/ffi-1.9.10/ HTTP/1.1" 200 14339
- -> /doc_root/ffi-1.9.10/
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/js/jquery.js HTTP/1.1" 200 91669
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/js/jquery.js
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/js/darkfish.js HTTP/1.1" 200 4666
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/js/darkfish.js
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/css/fonts.css HTTP/1.1" 404 2048
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/css/fonts.css
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/css/rdoc.css HTTP/1.1" 404 2048
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/css/rdoc.css
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/css/fonts.css HTTP/1.1" 404 2048
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/css/fonts.css
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/css/rdoc.css HTTP/1.1" 404 2048
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/css/rdoc.css
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/ffi-1.9.10/js/navigation.js HTTP/1.1" 404 14114
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/ffi-1.9.10/js/navigation.js
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/ffi-1.9.10/js/search_index.js HTTP/1.1" 200 60522
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/ffi-1.9.10/js/search_index.js
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/ffi-1.9.10/js/search.js HTTP/1.1" 404 14110
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/ffi-1.9.10/js/search.js
localhost.localdomain - - [29/Dec/2015:13:13:00 CET] "GET /doc_root/ffi-1.9.10/js/searcher.js HTTP/1.1" 404 14112
http://localhost:8808/doc_root/ffi-1.9.10/ -> /doc_root/ffi-1.9.10/js/searcher.js

Output of $ gem -v: 2.4.5.1

Notice the 404 errors when the web page is accessed. Expected behaviour is to correctly serve the CSS and JS files at the path where the documentation references them.

Greetings
Marvin


Files

0001-Fix-11924.patch (2.98 KB) 0001-Fix-11924.patch Patch which fixes this problem in Ruby 2.3.0 david_macmahon (David MacMahon), 04/11/2016 06:50 AM

History

Updated by Quintus (Marvin Gülker) almost 4 years ago

  • ruby -v set to ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]

Updated by nobu (Nobuyoshi Nakada) almost 4 years ago

  • Status changed from Open to Third Party's Issue

Updated by david_macmahon (David MacMahon) over 3 years ago

This is still happening for me with ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]. It seems to be caused by inconsistencies between URLs generated by darkfish and the RDoc::Servlet's expectations of which URLs are handled by darkfish. I have cobbled together a small patch (see attached file). It makes RDoc::Servlet aware of some URLs that darkfish generates (and can handle) and it fixes some relative URLs in darkfish's fonts.css file.

I'm not sure this is the best way to fix things. It might be better to keep RDoc::Servlet unchanged and instead change the darkfish generator to output URLs that RDoc::Servlet already knows are handled by darkfish, but I don't think so. darkfish references fonts.css and RDoc::Sservlet didn't know darkfish can handle requests for that asset so I think RDoc::Servlet really should be changed.

Updated by shyouhei (Shyouhei Urabe) over 3 years ago

FYI Zachary taught me that this is fixed upstream https://github.com/rdoc/rdoc/pull/360.

Also available in: Atom PDF