如果我通过 RVM 安装了 Rails,如何正确设置 Aptana RadRails?
我在http://railstutorial.org/上进行了安装,但我的脚本路径不起作用:例如:
- 'rails' 路径:/home/marius/.rvm/gems/ruby-1.8.7-p302@rails3gemset/bin/rails
- 检测到的路径:未检测到
如果我通过 RVM 安装了 Rails,如何正确设置 Aptana RadRails?
我在http://railstutorial.org/上进行了安装,但我的脚本路径不起作用:例如:
尝试在命令行中运行它。它将向您显示当前环境的可用 Rail 脚本的真实路径。
$哪个轨道
通过 rvm 安装 ruby 后,我可以通过以下方式让 eclipse 使用该安装:
In Eclipse, go to Window -> Preferences.
In the Ruby/Interpreters tab click "Search"
对我来说,这发现了所有从 rvm 安装的 ruby,并将它们添加到解释器列表中。为方便起见,我编辑了“名称”字段以包含版本号。
在 Aptana Studio 3(内部版本:3.0.8.201201201658)中,没有 Window -> 首选项。如果您的项目工作目录中有一个 .rvmrc,例如:
rvm use ruby-1.9.3-p0@mygemset
...那么 Aptana 应该选择正确的环境;在这种情况下,使用带有 gemset mygemset 的 ruby-1.9.3-p0。不要忘记从项目工作目录路径运行构建安装或构建更新(当您更新 Gemfile 时)。
我必须补充一点,在选择正确的环境时,Aptana Studio 3 似乎有点错误,尤其是在尝试使用 ruby-debug-ide19 时。
你试过了/home/marius/.rvm/gems/ruby-1.8.7-p302/bin/rails
吗?
您必须从终端会话运行 eclipse/aptana。
Please type command whereis ruby
in console.
you will get the path like /usr/bin/ruby
or /usr/local/bin/ruby
to check which is correct interpreter path /usr/bin/ruby -v
if you get version. that is your interpreter.
Please type command: rvm info
binaries:
ruby: "/home/<USERNAME>/.rvm/rubies/ruby-2.0.0-p247/bin/ruby"
copy this path and paste wherever you need enter you interpreter path.
It worked for me. and I hope it will help others as well.
Cheers!