How do I access Linux binaries from Windows when using WSL?

老子叫甜甜 提交于 2019-12-06 14:08:20

问题


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:

  1. 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.
  2. 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-bit Bash.exe from a 32-bit app.
  3. (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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!