简体   繁体   English

RubyMine错误:无法运行gem'rail'。 找不到'rails'

[英]RubyMine error: Unable to run gem 'rails'. Cannot find 'rails'

When I try to create Rails Application with RubyMine, it fails with message "Unable to run gem 'rails'. Cannot find 'rails'". 当我尝试使用RubyMine创建Rails应用程序时,它失败并显示消息“无法运行gem'trail'。无法找到'rails'”。 Why? 为什么? And how to solve it? 以及如何解决?

RubyMine's version is 4.0.2. RubyMine的版本是4.0.2。

There's some information about my system: 有一些关于我的系统的信息:

$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ gem -v
1.8.11
$ uname -a
Linux somehost 3.2.0-2-amd64 #1 SMP Tue Mar 20 18:36:37 UTC 2012 x86_64 GNU/Linux
$ lsb_release -d
Description:    Debian GNU/Linux testing (wheezy)
$ rails -v
Rails 3.2.3

Here's output of gem list --local: http://pastebin.com/CymzGUpf 这是宝石列表的输出--local: http ://pastebin.com/CymzGUpf

RubyMine see the same set of gems: http://ompldr.org/vZGM2eA RubyMine看到了同一组宝石: http//ompldr.org/vZGM2eA

Other IDEs for Ruby and Ruby on Rails (Eclipse with plugin DLTK-Ruby, Netbeans) work fine. Ruby和Ruby on Rails的其他IDE(带有插件DLTK-Ruby,Netbeans的Eclipse)工作正常。

What do I do wrong? 我做错了什么?

This problem is caused by ruby and rails executable files being located in different directories, normally they should be in the same directory and RubyMine is looking for the rails script in the same location where the configured ruby interpreter binary is. 此问题是由位于不同目录中的rubyrails可执行文件引起的,通常它们应位于同一目录中,而RubyMine正在配置的ruby解释器二进制文件所在的同一位置查找rails脚本。

In this particular case the locations were as follows: 在这种特殊情况下,地点如下:

  • /usr/local/bin/rails
  • /usr/bin/ruby

One of the solutions is to create a symlink of the rails script in the /usr/bin directory: 其中一个解决方案是在/usr/bin目录中创建rails脚本的符号链接:

sudo ln -s /usr/local/bin/rails /usr/bin/rails

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

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