RubyMine错误:无法运行gem'rails'.找不到“轨道" [英] RubyMine error: Unable to run gem 'rails'. Cannot find 'rails'

查看:99
本文介绍了RubyMine错误:无法运行gem'rails'.找不到“轨道"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用RubyMine创建Rails应用程序时,它失败并显示消息无法运行gem'rails'.找不到'rails'".为什么?以及如何解决?

When I try to create Rails Application with RubyMine, it fails with message "Unable to run gem 'rails'. Cannot find 'rails'". Why? And how to solve it?

RubyMine的版本为4.0.2.

RubyMine's version is 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

以下是宝石列表--local的输出: http://pastebin.com/CymzGUpf

Here's output of gem list --local: http://pastebin.com/CymzGUpf

RubyMine看到相同的宝石: http://ompldr.org/vZGM2eA

RubyMine see the same set of gems: http://ompldr.org/vZGM2eA

其他用于Ruby和Ruby on Rails的IDE(带有插件DLTK-Ruby的Eclipse,Netbeans)可以正常工作.

Other IDEs for Ruby and Ruby on Rails (Eclipse with plugin DLTK-Ruby, Netbeans) work fine.

我该怎么办?

推荐答案

此问题是由rubyrails可执行文件位于不同目录中引起的,通常它们应该位于同一目录中,并且RubyMine正在查找rails脚本位于配置的ruby解释程序二进制文件所在的位置.

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.

在这种情况下,位置如下:

In this particular case the locations were as follows:

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

解决方案之一是在/usr/bin目录中创建rails脚本的符号链接:

One of the solutions is to create a symlink of the rails script in the /usr/bin directory:

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

这篇关于RubyMine错误:无法运行gem'rails'.找不到“轨道"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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