简体   繁体   English

RubyMine 8开发无法正常工作。 继续说SDK中找不到Rails

[英]RubyMine 8 development not working. Keeps saying No Rails Found in SDK

Title kind of explains it. 标题类型解释它。 In both the Development Configuration and Preferences -> Languages -> Ruby SDK and Gems settings I have the correct Ruby version/Gemset selected. Development ConfigurationPreferences - > Languages - > Ruby SDK and Gems设置中,我选择了正确的Ruby版本/ Gemset。 But it still just saying: 但它仍然只是说:

Error running Development: the_factory: [No Rails found in SDK] 运行开发时出错:the_factory:[在SDK中找不到Rails]

I've used RubyMine on tons of projects and this has never given me a problem. 我已经在很多项目中使用了RubyMine,这从未给我带来任何问题。 But this is a new project, using Rails 5 and Ruby v2.3.0 , and I just can't figure out what's going on here. 但这是一个新项目,使用Rails 5Ruby v2.3.0 ,我只是无法弄清楚这里发生了什么。

This is in Ruby SDK and Gems settings in RubyMine 8: 这是RubyMine 8中的Ruby SDK and Gems设置: 在此输入图像描述

And this is my Development config: 这是我的Development配置: 在此输入图像描述

Update 更新

When I run rails server in my project folder, it works as expected. 当我在项目文件夹中运行rails server时,它按预期工作。

Ok, so I checked it out a little on RubyMine help page and I found this magical phrase: 好的,所以我在RubyMine帮助页面上查了一下,我发现了这个神奇的短语:

RubyMine supports Ruby versions 1.8.6 to 2.2 RubyMine支持Ruby版本1.8.6到2.2

在此输入图像描述

So I removed my rvm Ruby 2.3 version, installed Ruby 2.2.4, create a gemset with Rails 5. Then I assigned that gemset to my project and Voilá! 所以我删除了我的rvm Ruby 2.3版本,安装了Ruby 2.2.4,用Rails 5创建了一个gemset 。然后我将gemset分配给了我的项目和Voilá! It worked as expected. 它按预期工作。

Note: This answer my specific question at the date I write this. 注意:这是在我写这篇文章的时候回答我的具体问题。 But this obviously is not a long term answer, so if you are a future boy/girl with this very same problem, first check if your RubyMine version support Ruby >v2.3 before remove your current Ruby version. 但这显然不是一个长期的答案,所以如果你是一个有这个相同问题的未来男孩/女孩,首先检查你的RubyMine版本是否支持Ruby >v2.3然后删除你当前的Ruby版本。

For me the solution was that I had several Rails gem versions installed in my project directory. 对我来说,解决方案是我在项目目录中安装了几个Rails gem版本。

gem uninstall rails

was the way to go, removing any unwanted versions. 是要走的路,删除任何不需要的版本。 Feels like a contradiction - but uninstalling Rails meant that RubyMine could find Rails. 感觉像是矛盾 - 但卸载Rails意味着RubyMine可以找到Rails。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM