Forum: Ruby ri is suddenly empty

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fernando P. (Guest)
on 2009-04-03 10:14
Hi,

I don't understand what happened: today I wanted to look up for: ri
Array#unshift, and it had nothing:

Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.

>>


I tried other classes, and now I always get this error message. How to
fix that?



Thanks
matt neuburg (Guest)
on 2009-04-03 22:00
(Received via mailing list)
Fernando P. <removed_email_address@domain.invalid> wrote:

>
>
> I tried other classes, and now I always get this error message. How to
> fix that?

Oooh, oooh, call on me teacher, call on me, I know I know. It's because
you've defined an alias of "ri"; it now stands for "ri -i". When "ri"
stands for "ri -i", it ignores the argument that follows. Instead, it
presents the ">>" prompt, and *now* you can type the name of what you
want to look up. So:

Big-iMac-Attack:~ mattneub$ ri -i

Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.

>> Array#unshift
---------------------------------------------------------- Array#unshift
     array.unshift(obj, ...)  -> array

     From Ruby 1.8
------------------------------------------------------------------------
     Prepends objects to the front of array. other elements up one.

        a = [ "b", "c", "d" ]
        a.unshift("a")   #=> ["a", "b", "c", "d"]
        a.unshift(1, 2)  #=> [ 1, 2, "a", "b", "c", "d"]

>>
Big-iMac-Attack:~ mattneub$

Notice the blank line at the end (I hit Return) in order to get out of
interactive mode. m.
Michal S. (Guest)
on 2009-04-03 22:07
(Received via mailing list)
2009/4/3 matt neuburg <removed_email_address@domain.invalid>:
>>
> want to look up. So:
Then take it one step further: have it examine the command line, use
the arguments if any, and enter the interactive mode if none are
present ;-)

Thanks

Michal
Ryan D. (Guest)
on 2009-04-03 22:09
(Received via mailing list)
On Apr 3, 2009, at 11:06 , Michal S. wrote:

> Then take it one step further: have it examine the command line, use
> the arguments if any, and enter the interactive mode if none are
> present ;-)

patches welcome
matt neuburg (Guest)
on 2009-04-03 23:31
(Received via mailing list)
Ryan D. <removed_email_address@domain.invalid> wrote:

> On Apr 3, 2009, at 11:06 , Michal S. wrote:
>
> > Then take it one step further: have it examine the command line, use
> > the arguments if any, and enter the interactive mode if none are
> > present ;-)
>
> patches welcome

Actually the patch I really want is the ability to enter numbers instead
of text.

>> squeeze
     More than one method matched your request.  You can refine your
     search by asking for information on one of:

String#squeeze [Ruby 1.8]
String#squeeze [Ruby 1.8]
String#squeeze! [Ruby 1.8]
String#squeeze! [Ruby 1.8]
>>

Since there is no way to distinguish the first from the second, or the
third from the fourth, I am now USCWAP. In particular, there is
absolutely no way to get ri to provide an explanation for
String#squeeze! on my machine:

>> String#squeeze!
-------------------------------------------------------- String#squeeze!
     squeeze!(del=nil)

     From Ruby 1.8
------------------------------------------------------------------------
     [no description]

[Me: So show me the *other* one!]

m.
Fernando P. (Guest)
on 2009-04-04 00:41
> Oooh, oooh, call on me teacher, call on me, I know I know. It's because
> you've defined an alias of "ri"; it now stands for "ri -i".

nice catch! But I didn't directly create an alias for ri, instead I
created the following in my ~/.bash_profile:

export RI="--format=ansi --no-pager --interactive"


Is there any work around?
Eric H. (Guest)
on 2009-04-04 00:44
(Received via mailing list)
On Apr 3, 2009, at 12:29, matt neuburg wrote:
> instead
> of text.
>
>>> squeeze
>     More than one method matched your request.  You can refine your
>     search by asking for information on one of:
>
> String#squeeze [Ruby 1.8]
> String#squeeze [Ruby 1.8]
> String#squeeze! [Ruby 1.8]
> String#squeeze! [Ruby 1.8]

Somehow you managed to install ri data twice.  Try this:

find / -name "*squeeze-i.yaml"

Then delete one of the paths.

Please respond with the output of the find command so I can try to fix
this from RDoc.
matt neuburg (Guest)
on 2009-04-04 02:10
(Received via mailing list)
Eric H. <removed_email_address@domain.invalid> wrote:

> > Actually the patch I really want is the ability to enter numbers
> > String#squeeze! [Ruby 1.8]
>
> Somehow you managed to install ri data twice.

No, I don't think so. I mean, yes, I did, but I deleted the second set
of data some time ago (at your suggestion). But, this is different.
Look, you can see right on this Web page that there are two squeeze!
entries:

http://ruby-doc.org/core/classes/String.html

There are two squeeze entries and two squeeze! entries. Just like on my
machine. So it isn't just me, it's everybody. I don't know why, and I
don't care why; I'm just saying that since this kind of thing can and
does happen, it would be cool if ri would give me a way to choose
between them. m.
matt neuburg (Guest)
on 2009-04-04 02:12
(Received via mailing list)
Fernando P. <removed_email_address@domain.invalid> wrote:

> > Oooh, oooh, call on me teacher, call on me, I know I know. It's because
> > you've defined an alias of "ri"; it now stands for "ri -i".
>
> nice catch! But I didn't directly create an alias for ri, instead I
> created the following in my ~/.bash_profile:
>
> export RI="--format=ansi --no-pager --interactive"
>
> Is there any work around?

Sure, if you don't like the way ri behaves when --interactive is
switched on, don't switch --interactive on.

m.
Eric H. (Guest)
on 2009-04-04 02:52
(Received via mailing list)
On Apr 3, 2009, at 15:09, matt neuburg wrote:
>>>> patches welcome
>>> String#squeeze [Ruby 1.8]
> http://ruby-doc.org/core/classes/String.html
That webpage is not built with a stock RDoc template.  RDoc HTML
output and ri output are not the same.

> There are two squeeze entries and two squeeze! entries. Just like on
> my
> machine. So it isn't just me, it's everybody.

It's not me:

apple ruby 1.8.6 with RDoc 2.4.3:

$ ri String#squeeze
Updating ri class cache with 4563 classes...
--------------------------------------------------------- String#squeeze
      str.squeeze([other_str]*)    => new_str

      From Ruby 1.8
------------------------------------------------------------------------
      Builds a set of characters from the other_str parameter(s) using
      [...]

Ruby 1.8.8dev built today with RDoc 1.0.1:

$ ri18 String#squeeze
--------------------------------------------------------- String#squeeze
      str.squeeze([other_str]*)    => new_str
------------------------------------------------------------------------
      Builds a set of characters from the other_str parameter(s) using
      [...]

Ruby 1.9.1 with RDoc 2.4.2:

$ ri19 String#squeeze
Updating ri class cache with 1688 classes...
--------------------------------------------------------- String#squeeze
      str.squeeze([other_str]*)    => new_str

      From Ruby 1.9.1
------------------------------------------------------------------------
      Builds a set of characters from the other_str parameter(s) using
      [...]

So I don't believe this happens with a stock ruby or with a modern RDoc.

> I don't know why, and I
> don't care why; I'm just saying that since this kind of thing can and
> does happen, it would be cool if ri would give me a way to choose
> between them. m.

I can't fix this bug without your help.  You'll have to do some
investigation to find out what the problem is so I can reproduce and
fix it.
matt neuburg (Guest)
on 2009-04-04 08:24
(Received via mailing list)
Eric H. <removed_email_address@domain.invalid> wrote:

>       [...]
>
> I can't fix this bug without your help.  You'll have to do some
> investigation to find out what the problem is so I can reproduce and
> fix it.

Well:

Big-iMac-Attack:~ mattneub$ ri --list-doc-dirs
/usr/local/share/ri/1.8/system
/usr/local/lib/ruby/gems/1.8/doc/builder-2.1.2/ri
/usr/local/lib/ruby/gems/1.8/doc/columnize-0.2/ri
/usr/local/lib/ruby/gems/1.8/doc/fastri-0.3.1.1/ri
/usr/local/lib/ruby/gems/1.8/doc/hpricot-0.6.164/ri
/usr/local/lib/ruby/gems/1.8/doc/linecache-0.43/ri
/usr/local/lib/ruby/gems/1.8/doc/rake-0.8.3/ri
/usr/local/lib/ruby/gems/1.8/doc/rdoc-2.2.1/ri
/usr/local/lib/ruby/gems/1.8/doc/rubygems-1.3.1/ri
/usr/local/lib/ruby/gems/1.8/doc/rubytree-0.5.2/ri

So it isn't looking in any unusual places, and it isn't find two
complete sets of ri data. My guess is that you're going to tell me to
rebuild my ri data *again*. But every time I've done this, i.e. trying
to use "modern rdoc" against ruby 1.8.6 source, it's been a disaster.
That's why my current ri data is built with the rdoc that ships with the
1.8.6 source. I've asked for explicit instructions that work, but have
never gotten any. m.
Ryan D. (Guest)
on 2009-04-04 11:21
(Received via mailing list)
On Apr 3, 2009, at 21:19 , matt neuburg wrote:

> /usr/local/lib/ruby/gems/1.8/doc/rubytree-0.5.2/ri
find `ri --list-doc-dirs` -name \*squeeze-i.yaml

pls
matt neuburg (Guest)
on 2009-04-04 21:00
(Received via mailing list)
Ryan D. <removed_email_address@domain.invalid> wrote:

> > /usr/local/lib/ruby/gems/1.8/doc/rdoc-2.2.1/ri
> > /usr/local/lib/ruby/gems/1.8/doc/rubygems-1.3.1/ri
> > /usr/local/lib/ruby/gems/1.8/doc/rubytree-0.5.2/ri
>
> find `ri --list-doc-dirs` -name \*squeeze-i.yaml
>
> pls

/usr/local/share/ri/1.8/system/String/squeeze-i.yaml

m.

PS Your shell line didn't work OMM so I wrote a version in a language I
understand a little better, i.e. Ruby:

`ri --list-doc-dirs`.each {
   |s| puts `find '#{s.chomp}' -name '*squeeze-i.yaml'`
}

PPS I would just like to repeat that I don't actually care about this
particular problem. Even without the peculiar case of squeeze!, I would
*still* like interactive ri to present me with a list of numbers to type
instead of names. One or two characters (digits) is a much faster
alternative for picking the one you want.
Ryan D. (Guest)
on 2009-04-04 22:58
(Received via mailing list)
On Apr 4, 2009, at 09:59 , matt neuburg wrote:

> PPS I would just like to repeat that I don't actually care about this
> particular problem. Even without the peculiar case of squeeze!, I
> would
> *still* like interactive ri to present me with a list of numbers to
> type
> instead of names. One or two characters (digits) is a much faster
> alternative for picking the one you want.

So write a patch. We don't really care what you really care about or
not. We need a repro for this problem and we have yet to have anyone
give us one.
Ryan D. (Guest)
on 2009-04-04 23:09
(Received via mailing list)
On Apr 3, 2009, at 21:19 , matt neuburg wrote:

> /usr/local/lib/ruby/gems/1.8/doc/rubytree-0.5.2/ri
I don't have those in my gauntlet setup. I've got:

builder-2.1.2.tgz
columnize-0.3.0.tgz
fastri-0.3.1.1.tgz
hpricot-0.7.tgz
linecache-0.43.tgz
rake-0.8.4.tgz
rdoc-2.4.1.tgz
rubytree-0.5.2.tgz

+ rubygems via svn. I've grepped through all of them and none of them
define a squeeze method. So I'm still without a repro. The code I used
is below and I dry ran it with def.+initialize to ensure I was doing
it right:
This topic is locked and can not be replied to.