Skip to content

'gem server' does not honor gem sets #321

Closed
ddd opened this Issue Apr 28, 2012 · 5 comments

3 participants

@ddd
ddd commented Apr 28, 2012

This is off an issue I discussed with @mpapis in #RVM on freenode
I searched the Issues but didn't find anything relating to this, so if I am double reporting, I apologize.

The issues is this. Under RVM I issue a rvm docs generate all which creates the documentation for that Ruby the command was run under, as well as the docs for any installed gems. All docs for all gems, whether in the global or in the current gem set, are in fact built.

However, if you subsequently run gem server, any gems not in the current gem set (such as those installed in the global) will have a click-able link for it's rdocs, but the documentation page will never be found. You get the following, for example:

`/doc_root/pry-nav-0.2.1/rdoc/index.html' not found.`

If you change to the global gem set then they are found.

pry-0.9.9.4 Documentation

This is the API documentation for 'pry-0.9.9.4 Documentation'.

If I am correct, the gem server uses $GEM_PATH. However, when it runs it no longer honors it:

∴ echo $GEM_PATH
/home/me/.rvm/gems/ruby-1.9.3-p125@me:/home/me/.rvm/gems/ruby-1.9.3-p125@global

Running gem --debug server from within the global gem set where the gem actually resides shows:

19:10:58 me@opensuse:~  ruby-1.9.3-p125@global 
∴ gem --debug server
Exception `NameError' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::ServerCommand
Exception `SocketError' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/utils.rb:60 - getaddrinfo: Name or service not known
Exception `Errno::EADDRINUSE' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/utils.rb:85 - Address already in use - bind(2)
Server started at http://0.0.0.0:8808
localhost - - [28/Apr/2012:19:11:12 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/index.html HTTP/1.1" 200 43617
http://0.0.0.0:8808/ -> /doc_root/pry-0.9.9.4/rdoc/index.html
Exception `WEBrick::HTTPStatus::NotModified' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:34 - WEBrick::HTTPStatus::NotModified
localhost - - [28/Apr/2012:19:11:12 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/rdoc.css HTTP/1.1" 304 0
http://0.0.0.0:8808/doc_root/pry-0.9.9.4/rdoc/index.html -> /doc_root/pry-0.9.9.4/rdoc/rdoc.css
Exception `WEBrick::HTTPStatus::NotModified' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:34 - WEBrick::HTTPStatus::NotModified
localhost - - [28/Apr/2012:19:11:12 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/js/jquery.js HTTP/1.1" 304 0
http://0.0.0.0:8808/doc_root/pry-0.9.9.4/rdoc/index.html -> /doc_root/pry-0.9.9.4/rdoc/js/jquery.js
Exception `WEBrick::HTTPStatus::NotModified' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:34 - WEBrick::HTTPStatus::NotModified
Exception `WEBrick::HTTPStatus::NotModified' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:34 - WEBrick::HTTPStatus::NotModified
localhost - - [28/Apr/2012:19:11:12 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/js/quicksearch.js HTTP/1.1" 304 0
Exception `WEBrick::HTTPStatus::NotModified' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:34 - WEBrick::HTTPStatus::NotModified
http://0.0.0.0:8808/doc_root/pry-0.9.9.4/rdoc/index.html -> /doc_root/pry-0.9.9.4/rdoc/js/quicksearch.js
localhost - - [28/Apr/2012:19:11:12 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/js/thickbox-compressed.js HTTP/1.1" 304 0
http://0.0.0.0:8808/doc_root/pry-0.9.9.4/rdoc/index.html -> /doc_root/pry-0.9.9.4/rdoc/js/thickbox-compressed.js
localhost - - [28/Apr/2012:19:11:12 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/js/darkfish.js HTTP/1.1" 304 0
http://0.0.0.0:8808/doc_root/pry-0.9.9.4/rdoc/index.html -> /doc_root/pry-0.9.9.4/rdoc/js/darkfish.js
Exception `WEBrick::HTTPStatus::NotFound' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:316 - `/doc_root/pry-0.9.9.4/images/loadingAnimation.gif' not found.
localhost - - [28/Apr/2012:19:11:13 EDT] "GET /doc_root/pry-0.9.9.4/images/loadingAnimation.gif HTTP/1.1" 404 316
http://0.0.0.0:8808/doc_root/pry-0.9.9.4/rdoc/index.html -> /doc_root/pry-0.9.9.4/images/loadingAnimation.gif
Exception `WEBrick::HTTPStatus::NotModified' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:34 - WEBrick::HTTPStatus::NotModified
Exception `WEBrick::HTTPStatus::NotModified' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:34 - WEBrick::HTTPStatus::NotModified
Exception `WEBrick::HTTPStatus::NotModified' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:34 - WEBrick::HTTPStatus::NotModified
localhost - - [28/Apr/2012:19:11:13 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/images/bullet_black.png HTTP/1.1" 304 0
localhost - - [28/Apr/2012:19:11:13 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/images/package.png HTTP/1.1" 304 0
http://0.0.0.0:8808/doc_root/pry-0.9.9.4/rdoc/rdoc.css -> /doc_root/pry-0.9.9.4/rdoc/images/package.png
http://0.0.0.0:8808/doc_root/pry-0.9.9.4/rdoc/rdoc.css -> /doc_root/pry-0.9.9.4/rdoc/images/bullet_black.png
localhost - - [28/Apr/2012:19:11:13 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/images/ruby.png HTTP/1.1" 304 0
http://0.0.0.0:8808/doc_root/pry-0.9.9.4/rdoc/rdoc.css -> /doc_root/pry-0.9.9.4/rdoc/images/ruby.png

Running gem --debug server shows the following:

19:14:34 me@opensuse:~  ruby-1.9.3-p125@me 
∴ gem --debug server
Exception `NameError' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::ServerCommand
Exception `SocketError' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/utils.rb:60 - getaddrinfo: Name or service not known
Exception `Errno::EADDRINUSE' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/utils.rb:85 - Address already in use - bind(2)
Server started at http://0.0.0.0:8808
Exception `WEBrick::HTTPStatus::NotFound' at /home/me/.rvm/rubies/ruby-1.9.3-p125/lib64/ruby/1.9.1/webrick/httpservlet/filehandler.rb:316 - `/doc_root/pry-0.9.9.4/rdoc/index.html' not found.
localhost - - [28/Apr/2012:19:14:44 EDT] "GET /doc_root/pry-0.9.9.4/rdoc/index.html HTTP/1.1" 404 304
http://0.0.0.0:8808/ -> /doc_root/pry-0.9.9.4/rdoc/index.html
@xirotyu
xirotyu commented Apr 29, 2012

"gem server -d $GEM_PATH" solve the problem?

@ddd
ddd commented Apr 29, 2012
@drbrain
RubyGems member
drbrain commented Nov 27, 2012

I think this will be fixed by the upcoming use of the RDoc 4 gem servlet. Please stand by.

@drbrain drbrain was assigned Nov 27, 2012
@drbrain
RubyGems member
drbrain commented Oct 24, 2013

There was a bug in gem server -d that was fixed by @1953684 aka #696 which may have fixed this problem. Can someone check it for me?

@drbrain
RubyGems member
drbrain commented Nov 26, 2013

Assuming this is fixed.

@drbrain drbrain closed this Nov 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.