问题
I'm experimenting with the new Windows Subsystem for Linux as a way to develop Rails applications in Windows. I have WSL installed and I have Ruby in it but how do I use that Ruby from a Windows GUI application, specifically, RubyMine:
This is so I can easily start rails, run tests, etc.
回答1:
A few things:
- Open a bash console and leave it open when you're running RubyMine: As soon as you close your last bash session, WSL tears down all running Linux processes.
- I believe RubyMine is a 32-bit app. WSL's tools are 64-bit. Therefore you need to call
c:\\Windows\\Sysnative\\Bash.exe
to invoke the 64-bitBash.exe
from a 32-bit app. - (While your bash console is open) You can either call bash & ask it to execute your command:
c:\\Windows\\Sysnative\\Bash.exe -c "<command>"
, or you can start sshd in Bash and then "remote" into it from RubyMine and drive ruby as if you were driving a remote Linux box/VM.
回答2:
If anyone is wondering how this can be done at this time with the latest version of Ruby, there is a WSL connector for the remote repo of ruby.
来源:https://stackoverflow.com/questions/41495626/how-do-i-access-linux-binaries-from-windows-when-using-wsl