After installing some gems, the system recommended that I refresh ri
and rdoc. I may have actually updated the ri and rdoc programs too;
unfortunately I don’t remember which commands I used. After that,
whenever I use ri the output is full of ANSI color sequences; I’m on
Windows (using 1.9.1p429 from RubyInstaller) using the Windows
console, so they don’t display as color. I thought maybe installing
win32console would fix it, but it didn’t.
So: What commands might I have typed that put color sequences into ri?
And how do I either remove the color sequences, or make them display
as color?
On Sep 28, 8:14 pm, Eric C. [email protected]
wrote:
as color?
By “ri colors” you mean invoking “ri Kernel.system” ?
If you used RubyInstaller releases, you should get:
No usage information available for this program
Note to developer: requested section(s) [Installing Documentation] not
found
But since you mention you generated yourself, this could be related to
rdoc-data, right?
I’m unaware of any command that turns ri ANSI color coding except if
the documentation was generated with these colors.
Can you check the ri yaml documents for these ANSI escape sequences?
On Sep 28, 9:09Â pm, Eric C. [email protected]
wrote:
You’re saying that a default RubyInstaller installation shouldn’t have
any documentation for Kernel.system? That seems odd.
No, we replaced ri documentation (due its bulkiness) with Windows Help
files (CHM)
Where would I find those?
In your home directory there should be a folder named .ri
To know where is you home directory, execute “gem env path”
There should be two directories, one under your Ruby installation (C:
\RubyXYZ) and other inside Users or whatever is configured your system
to store your personal files.
Look for the kernel and system yaml files and see if there are ANSI
codes in them.
On Tue, Sep 28, 2010 at 11:00 PM, Luis L. [email protected]
wrote:
There should be two directories, one under your Ruby installation (C:
\RubyXYZ) and other inside Users or whatever is configured your system
to store your personal files.
Oh, is that what that folder contains. I have been (kind of stupidly)
just deleting .ri and .gem in my home directory because I have my home
directory set up as a menu off the Start menu, and they always show up
as the first entries on the menu (which I don’t want).
Is there a way I can get gem/rdoc/ri to keep their .ri and .gem
folders somewhere other than my home directory?
Look for the kernel and system yaml files and see if there are ANSI
codes in them.
Tomorrow I will try installing a gem and look in the .ri folder.
On Tue, Sep 28, 2010 at 6:48 PM, Luis L. [email protected]
wrote:
So: What commands might I have typed that put color sequences into ri?
And how do I either remove the color sequences, or make them display
as color?
By “ri colors” you mean invoking “ri Kernel.system” ?
If you used RubyInstaller releases, you should get:
No usage information available for this program
Note to developer: requested section(s) [Installing Documentation] not
found
Well, using Kernel.system as an example, I get:
â†[0mâ†[1;32mKernel.systemâ†[m
(from ruby core)
system([env,] cmd [, arg, …] [,options]) => true, false or nil
[etc.]
You’re saying that a default RubyInstaller installation shouldn’t have
any documentation for Kernel.system? That seems odd.
But since you mention you generated yourself, this could be related to
rdoc-data, right?
Oh, possibly; I do have the rdoc-data gem.
I’m unaware of any command that turns ri ANSI color coding except if
the documentation was generated with these colors.
Can you check the ri yaml documents for these ANSI escape sequences?
Where would I find those?
On Thu, Sep 30, 2010 at 11:34 AM, Roger P. [email protected]
wrote:
Well, using Kernel.system as an example, I get:
â†[0mâ†[1;32mKernel.systemâ†[m
ri doesn’t have a “–no-color” option?
It probably should (and used to work fine). Â Maybe take it up with them.
Apparently it doesn’t any longer. And I’m still a little confused as
to why ri output now has colors by default, though – I don’t know if
it’s a change in ri, or if the new rdoc files I just installed have
colors embedded in them, or what. (I don’t recall which ri files used
to display without colors.)
Also (this is to Luis), I tried removing and reinstalling some gems,
and I still don’t have a .ri folder, nor have I found any YAML files
in my whole Ruby installation.
Until then you could try installing the win32-console gem, or pipe your
output through wac [1] or perhaps instruct your computer to load
ansi.sys [2] (though I’ve never tried the latter).
I did try win32console, but it didn’t help. I will look into wac. And
from my recent reading on the subject, ansi.sys doesn’t work in modern
versions of Windows.
Well, using Kernel.system as an example, I get:
â†[0mâ†[1;32mKernel.systemâ†[m
ri doesn’t have a “–no-color” option?
It probably should (and used to work fine). Maybe take it up with them.
Until then you could try installing the win32-console gem, or pipe your
output through wac [1] or perhaps instruct your computer to load
ansi.sys [2] (though I’ve never tried the latter).
[1]
http://groups.google.com/group/cukes/browse_thread/thread/14a4ded4d083f7c?pli=1
[2] http://support.microsoft.com/kb/101875
On Sep 30, 4:43 pm, Eric C. [email protected]
wrote:
Also (this is to Luis), I tried removing and reinstalling some gems,
and I still don’t have a .ri folder, nor have I found any YAML files
in my whole Ruby installation.
ri documentation for gems is installed along the gem inside rubygems
directory.
Try this:
gem which win32console
And see the path that is output, one level above gems/win32console* is
where you could find “docs” directory for gems
Since you mention rdoc-data I pointed you to .ri in your home
directory because that is where it stores it.
I did try win32console, but it didn’t help. I will look into wac. And
from my recent reading on the subject, ansi.sys doesn’t work in modern
versions of Windows.
wac doesn’t need ansi.sys, it mentions that emulates what ansi used to
do.
On Thu, Sep 30, 2010 at 11:34 AM, Roger P. [email protected]
wrote:
Well, using Kernel.system as an example, I get:
â†[0mâ†[1;32mKernel.systemâ†[m
ri doesn’t have a “–no-color” option?
It probably should (and used to work fine). Â Maybe take it up with them.
Until then you could try installing the win32-console gem, or pipe your
output through wac [1] or perhaps instruct your computer to load
ansi.sys [2] (though I’ve never tried the latter).
I tried wac and it worked very well, for one day. But now it seems to
strip out the color codes without actually changing the text color.
Does anyone know what might cause that? I haven’t changed anything
that I can think of, and wac doesn’t have any config files or
anything, so I don’t get it.
So: What commands might I have typed that put color sequences into ri?
And how do I either remove the color sequences, or make them display
as color?
GitHub - adoxa/ansicon: Process ANSI escape sequences for Windows console programs. might help too
Eric C. wrote in post #944561:
After installing some gems, the system recommended that I refresh ri
and rdoc. I may have actually updated the ri and rdoc programs too;
unfortunately I don’t remember which commands I used. After that,
whenever I use ri the output is full of ANSI color sequences; I’m on
Windows (using 1.9.1p429 from RubyInstaller) using the Windows
console, so they don’t display as color. I thought maybe installing
win32console would fix it, but it didn’t.
So: What commands might I have typed that put color sequences into ri?
And how do I either remove the color sequences, or make them display
as color?
The easiest way I found on Windows to solve this is to just set the RI
environment variable to use the “bs” formatter instead of the default
“ansi”.
You can test this in a CMD session using…
set RI=–format bs
…then you can run various “ri” commands to see that it’s working.
You can also set this permanently in your Advanced system settings via:
- Windows-key + Pause/Break (this is a nice control panel System
shortcut key)
- Click on “Advanced system settings”
- Click on “Environment Variables…” button
- In the “System variables” section, click “New…” button
- In “Variable name:” text field, add “RI”
- In “Variable value:” text field, add “–format bs”
- Click OK on the various dialogs and close the System control panel
Now you can launch a new CMD session and your “ri” commands will be
plain text.
Enjoy!
On Sun, Oct 13, 2013 at 3:55 PM, Steve S. [email protected]
wrote:
And how do I either remove the color sequences, or make them display
…then you can run various “ri” commands to see that it’s working.
Now you can launch a new CMD session and your “ri” commands will be
plain text.
Enjoy!
Thanks!
It’s been so long since I ran ri under Windows that I’m not sure I even
have this problem anymore; but when I go back to work I will try it out.