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 sh开发者_开发技巧ortcut 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?
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
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>
精彩评论