ri for gems working?

R

Roger Pack

For some reason I've never had success with ri + gems

ex:
rdp@li49-39:~$ gem install eventmachine
Successfully installed eventmachine-0.12.8
Installing ri documentation for eventmachine-0.12.8...
rdp@li49-39:~$ ri EventMachine
No ri documentation found in:

Was rdoc run to create documentation?


Installing Documentation
------------------------
'ri' uses a database of documentation built by the RDoc utility.

So, how do you install this documentation on your system? It depends on
how you installed Ruby.

_If you installed Ruby from source files_ (that is, if it some point you
typed 'make' during the process :), you can install the RDoc
documentation yourself. Just go back to the place where you have your
Ruby source and type

make install-doc

You'll probably need to do this as a superuser, as the documentation is
installed in the Ruby target tree (normally somewhere under
+/usr/local+.

_If you installed Ruby from a binary distribution_ (perhaps using a
one-click installer, or using some other packaging system), then the
team that produced the package probably forgot to package the
documentation as well. Contact them, and see if they can add it to the
next release.



shouldn't it have picked up the ri from the gem just installed?
Just wondering if this is a bug.
Thanks.
-=r
 
J

James Herdman

[Note: parts of this message were removed to make it a legal post.]

Hi Roger.
Depending on how the documentation for EventMachine was written, your RI
command may not have been enough.

Try running the command "gem server". This will start up a web server that
hosts all of your local RDocs. Point your web browser of choice at
http://localhost:8808. You can find your docs here. Take a look at how
EventMachine does their documentation. That may help you use RI with the
EventMachine docs in the future.

I know the above solution isn't perfect, but given that documentation
quality is highly variable between projects, it's often the best solution.

James H.
 
M

Matt Neuburg

James Herdman said:
Try running the command "gem server". This will start up a web server that
hosts all of your local RDocs.

Wow! Why didn't someone tell me about this sooner!!!?????

m.
 
B

Brian Candler

Roger said:
shouldn't it have picked up the ri from the gem just installed?

Possibly. Old versions of rubygems used to have a 'gemri' command, but
it doesn't seem to be there any more.

You can give the path explicitly: e.g.

ri -d /var/lib/gems/1.8/doc/activerecord-2.3.2/ri ActiveRecord::Base

But I find it easier just to do "gem server --daemon" then point a
browser at http://127.0.0.1:8808/
 
E

Eric Hodel

For some reason I've never had success with ri + gems

ex:
rdp@li49-39:~$ gem install eventmachine
Successfully installed eventmachine-0.12.8
Installing ri documentation for eventmachine-0.12.8...
rdp@li49-39:~$ ri EventMachine
No ri documentation found in:

Was rdoc run to create documentation?
[...]

shouldn't it have picked up the ri from the gem just installed?
Just wondering if this is a bug.

Depending on your ruby and RDoc version, ri may not pick up RubyGems
paths. Try installing RDoc 2.
 
R

Roger Pack

Depending on your ruby and RDoc version, ri may not pick up RubyGems
paths. Try installing RDoc 2.

nice
C:\>gem install rdoc

and it works now for gems. You rock.
-=r
 
T

Tom Cloyd

Matt said:
Wow! Why didn't someone tell me about this sooner!!!?????

m.
Precisely my reaction. I'll say it again: If you code up something cool,
then don't market it, what's the point? Saying - "go read the code"
doesn't cut it. Put a message somewhere in the installation output. In
this - Eric H. - your wonderful Rubygems install/update CLI output needs
an addition, I'd say.

T.

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< (e-mail address removed) >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
B

Ben Bleything

Precisely my reaction. I'll say it again: If you code up something cool,
then don't market it, what's the point? Saying - "go read the code" doesn= 't
cut it. Put a message somewhere in the =A0installation output. In this - = Eric
H. - your wonderful Rubygems install/update CLI output needs an addition,
I'd say.

gem server has been around _forever_. It's in gem help. It's
mentioned in every book I've seen that talks about the RubyGems
system. Until this thread I thought it was common knowledge.

This isn't a marketing failure, though. You can't call out every
feature every time, plus many (most?) people never actually run the
rubygems installer. It is the user's responsibility to know their
tools. In this case, thinking "I wonder how to read the docs on a
gem?" and then running 'gem help' would have shown this immediately.

Ben
 
E

Eric Hodel

Precisely my reaction. I'll say it again: If you code up something
cool, then don't market it, what's the point? Saying - "go read the
code" doesn't cut it. Put a message somewhere in the installation
output. In this - Eric H. - your wonderful Rubygems install/update
CLI output needs an addition, I'd say.


You mean where it moved from `gem_server` to `gem server`:

0.9.5: http://rubyforge.org/forum/forum.php?forum_id=23112

Or where there were bug fixes or new features:

1.0.0: http://rubyforge.org/forum/forum.php?forum_id=23113
1.1.1: http://rubyforge.org/forum/forum.php?forum_id=23525
1.2.0: http://rubyforge.org/forum/forum.php?forum_id=25353
1.3.3: http://rubyforge.org/forum/forum.php?forum_id=32072

I know this last one at least put the message in the installation
output.

I also know that nobody reads it.

PS: It looks like gem_server has existed since the beginning of time, http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/94935
mentions "Serve gems via webrick or CGI".
 
R

Roger Pack

Ben said:
gem server has been around _forever_. It's in gem help. It's
mentioned in every book I've seen that talks about the RubyGems
system. Until this thread I thought it was common knowledge.

Unfortunately it isn't...totally expected...how to describe it...to run
a server in order to access rdocs, so many [most?] users just go happily
on their way without accessing local rdocs [or come up with their own
auto complete scripts [1] or static pages [2] [3]] for them.

What I'd like to see would be a plugin that updates a static index.html
page for them at install time. Though I suppose that wouldn't be
searchable...

The good news is that there are a few libs out there [gembox, sinatra
gem server] which try to fill that void, too. They look pretty spiffy.
Stay well.
-=r


[1] http://github.com/cldwalker/dotfiles/tree/master
[2] http://blog.olszowka.de/2009/02/13/rdoc-index-for-your-gems/ from
http://jasonseifer.com/2009/02/22/offline-gem-server-rdocs
[3] http://www.ruby-forum.com/topic/158828
 
M

Michael Guterl

Ben said:
gem server has been around _forever_. =C2=A0It's in gem help. It's
mentioned in every book I've seen that talks about the RubyGems
system. =C2=A0Until this thread I thought it was common knowledge.

Unfortunately it isn't...totally expected...how to describe it...to run
a server in order to access rdocs, so many [most?] users just go happily
on their way without accessing local rdocs [or come up with their own
auto complete scripts [1] or static pages [2] [3]] for them.

What I'd like to see would be a plugin that updates a static index.html
page for them at install time. =C2=A0Though I suppose that wouldn't be
searchable...

The good news is that there are a few libs out there [gembox, sinatra
gem server] which try to fill that void, too. =C2=A0They look pretty spif= fy.
Stay well.
-=3Dr


[1] http://github.com/cldwalker/dotfiles/tree/master
[2] http://blog.olszowka.de/2009/02/13/rdoc-index-for-your-gems/ from
http://jasonseifer.com/2009/02/22/offline-gem-server-rdocs
[3] http://www.ruby-forum.com/topic/158828
--

I like bdoc http://github.com/manalang/bdoc/tree/master

"Bdoc is a simple replacement for gem server. All it does is look at
all of the Gems you have installed locally and creates a nice iframe
based browser that makes it easy to navigate between gem docs. IT DOES
NOT REQUIRE A SERVER FOR VIEWING=E2=80=A6 not like gem server does!"

Best,
Michael Guterl
 
E

Eric Hodel

So is Hannah or Darkfish better?

Last I heard, Hannah only worked on RDoc 2.3 and earlier. Darkfish is
the way of the future, and provided Hannah was ported to RDoc 2.4+ it
would simply be a matter of taste.
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top