Mr. Kennedy Mr. Kennedy - 1 year ago 194
PowerShell Question

How to use ri with Ruby in powershell?

When I enter "ri" the powershell thinks it is "Remove-Item" - how do I use the ri command to invoke the "R"uby "I"ndex?

After poking around SO: ruby 1.9 ri on Windows knows nothing about any classes I tried cd'ing to the C:\Ruby22 and entering:

rdoc --all --ri

This successfully installed gems and such, but ri remained 'remove item'. I searched the web and the Ruby docs. Having found this: I entered these into the powershell command line:

gem install rdoc rdoc-data
rdoc-data --install

but when I enter "ri" the powershell still thinks it is "Remove-Item"

How can I use the ruby documentation tool?

I duplicated these files:



And renamed them to:



Now I can enter "rr" in Powershell and get the functionality of the Ruby "r"uby "i"ndex.

How would I change the existing "ri" command in Powershell?

Answer Source

I entered this in Powershell's command line prompt:

rm -Force alias:ri

to get rid of the (ri = Remove-Item) association.

Now I can delete the duplicate files I named C:\Ruby22\bin\rr & rr.bat and having set-up the Ruby Index with the above commands, Powershell recognizes "ri" as the command for Ruby Index. Yay.

Pardon my ignorance of shell conventions, but I found this resource useful:

...and lastly, the other "remove" commands still work just fine: Remove-Item, remove-item, rm, rmdir, rd...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download