RubyMine无法识别我的Ruby安装路径 [英] RubyMine doesn't recognize my Ruby installation path

查看:191
本文介绍了RubyMine无法识别我的Ruby安装路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经制作了 Ruby 2.0 的自定义定向安装程序,其中包含一些 gems extras ,我的安装程序扩展了所有 Ruby 文件到 c:\ Program Files(x86)\ Ruby ,解释器( ruby​​.exe )在 Bin 文件夹中,一切正常,但不是原始安装,我扩展了文件,并添加了注册表项以自行关联文件,我可以根据需要正常运行Ruby.

I've made a custom sient installer of Ruby 2.0 with some gems and extras, my installer expands all the Ruby files to c:\Program Files (x86)\Ruby, the interpreter (ruby.exe) is in the Bin folder, all is as normally but just it's not an original installation, I expand the files and I add the registry keys to associate files by my own, I can run Ruby as normally ever I want.

现在,这是我第一次尝试使用 JetBrains RubyMine IDE,但是我找不到一个简单的指南来解释如何设置Ruby目录,似乎该IDE假定使用了Ruby安装是原始的,也许会从原始Ruby安装程序获取注册表值来了解Path或我不知道的东西,但是我没有看到有关如何手动设置Ruby目录的任何帮助.

Now, is the first time that I try the JetBrains RubyMine IDE, and I can't found a simple guide which explains how to set the Ruby directory, seems that this IDE assumes that the Ruby installation is original and maybe takes a registry value from the original Ruby installer to know the Path or something, I don't know, but just I didn't see any help about how to set the Ruby directory manually.

(我对PyCharm也有同样的问题)

(I have the same problem for PyCharm)

无论如何,我尝试通过 Ruby SDK和Gems 选项进行设置,对话框中显示选择Ruby解释器路径",但是我在该路径上,并且无法识别,我的意思是确定按钮仍处于禁用状态:

Anyways I've tried to set it from the Ruby SDK and Gems option, the dialog-box says "select Ruby interpreter Path", but I'm on the Path and it's not recognized, I mean that the Ok button still disabled:

那我在任何地方都缺少正确的选择吗?还是真的像这样的专业且昂贵的IDE不支持仅在用户不使用原始Ruby安装程序的情况下指定 Ruby 的位置? 我真的不认为.

Then I'm missing the right option anywhere? or really a professional and expensive IDE like this doesn't has support just to specify the location of Ruby in these circunstance where an user does not use the original Ruby installer? I really will think not.

推荐答案

以我的经验,最好设置适当的PATH环境变量,而不是尝试按应用定位可执行文件.

In my experience it is more preferable to set your PATH environment variables appropriately instead of trying to locate executables on a per-app basis.

您可以设置路径,以便所需的Ruby优先于其他任何红宝石,并且我确信RubyMine会选择它(或仅使用ruby并让您的PATH指定要使用的宝石).

You can set your path so that the desired Ruby takes precedence over any other rubies and I am sure that RubyMine will pick it up (or just use ruby and let your PATH specify which to use).

另一方面,您可能还希望看一看ruby版本管理器,例如rbenv或RVM.

On another note you might also want to have a look at a ruby version manager such as rbenv or RVM.

更新:刚刚尝试在最新版本的RubyMine(6.3)中手动设置Ruby SDK,并且按预期工作.但是,我必须展开二进制文件所在的文件夹(在您的情况下为bin),选择实际的二进制文件,然后单击确定".您也尝试过吗?

Update: Just tried to set manually a Ruby SDK in the latest version of RubyMine (6.3) and it worked as expected. I had, however, to expand the folder in which the binary resided (in your case bin), select the actual binary and then click OK. Have you tried that as well?

这篇关于RubyMine无法识别我的Ruby安装路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆