且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

RubyMine错误:无法运行gem'rails'.找不到“轨道"

更新时间:2023-11-28 08:44:28

此问题是由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