agente_secreto
agente_secreto

Reputation: 8079

How can I execute Ruby scripts and irb from Windows7 Powershell?

I used the Windows Ruby Installer, and all I can do is run ruby from the normal command line with a bundled shortcut named "Command line with ruby".

Windows 7 Powershell is not bad as a replacement for bash, so I would like to be able to execute Ruby, irb, gem etc from it. At the very least executing scripts...

I've read that this is possible, how?

Upvotes: 6

Views: 8919

Answers (2)

RussianJohnResig
RussianJohnResig

Reputation: 21

I've made it like this change directory to the place, where Ruby is installed(in my case this is C:\Ruby193\bin)

C:\Users\admin>cd C:\Ruby193\bin

and there simply typed irb and pressed enter:

C:\Ruby193\bin>irb
irb(main):001:0> 1+4
=> 5
irb(main):002:0>

Upvotes: 2

Will Gorman
Will Gorman

Reputation: 879

Is the directory that Windows Ruby Installer installed to (like C:\Ruby192\bin) on your path? I can't recall if it should add that automatically on install but I've not had any issues running irb or scripts from powershell. You can check if it's on your path by running the following from a powershell session:

$env:path

Upvotes: 4

Related Questions