如何将 Eclipse 用于 Ruby on Rails (RoR)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12366924/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use Eclipse for Ruby on Rails (RoR)
提问by Ripon Al Wasim
I am new in Ruby. I have installed Ruby on Rails on Windows 7. I visited the following to choose a suitable IDE/Editor for writing Ruby code:
我是 Ruby 新手。我已经在 Windows 7 上安装了 Ruby on Rails。我访问了以下内容以选择合适的 IDE/编辑器来编写 Ruby 代码:
http://rubyonrails.org/download
http://rubyonrails.org/download
I found the following Editors for Ruby:
我找到了以下 Ruby 编辑器:
VIM for Rails, RadRails, RubyMine, 3rd Rail, Netbeans for Ruby
VIM for Rails、RadRails、RubyMine、3rd Rail、Netbeans for Ruby
I am familiar with Eclipse as I am using Eclipse for java. Can I use Eclipse for Ruby? If so, what configuration is necessary in Eclipse for Ruby project?
我熟悉 Eclipse,因为我将 Eclipse 用于 Java。我可以将 Eclipse 用于 Ruby 吗?如果是这样,Eclipse 的 Ruby 项目需要什么配置?
回答by Bryan Wolfford
To save you some legwork, in Eclipse:
为了节省您的一些麻烦,在 Eclipse 中:
- Go to Help -> Install New Software...
- Click add (top right of popup)
- Enter a Name like "RadRails2"
- Enter the location as http://download.aptana.com/tools/radrails/plugin/install/radrails-bundle(for the full Aptana studio Studio 3, instead enter http://download.aptana.com/studio3/plugin/install)
- Click ok
- Restart Eclipse
- Go to Window -> Preferences. You will see Ruby is enlisted at left panel
- 转到帮助 -> 安装新软件...
- 单击添加(弹出窗口的右上角)
- 输入一个名称,如“RadRails2”
- 输入位置为http://download.aptana.com/tools/radrails/plugin/install/radrails-bundle(对于完整的 Aptana studio Studio 3,请输入http://download.aptana.com/studio3/plugin/安装)
- 单击确定
- 重启 Eclipse
- 转到窗口 -> 首选项。您将在左侧面板中看到 Ruby 已登记
You are done...
你完成了...
Now when you use the "New" menu, you'll have the option to make a Ruby project (among other things).
现在,当您使用“新建”菜单时,您将可以选择创建 Ruby 项目(除其他外)。
回答by lutinwood
You need to install aptana sudio eclipse plugin and radrails will be included.
您需要安装 aptana sudio eclipse 插件并且将包含 radrails。
refer to this Cannot Install Aptana plugin on Eclipse 4.2
回答by Faysal Ahmed
I am using Eclipse Luna and installed Ruby(DLTK) 5.0 kepler from Eclipse Marketplace. I just imported my existing Rails project and seeing it working well with this. I am still exploring it. Hope that helps.
我正在使用 Eclipse Luna 并从 Eclipse Marketplace 安装了 Ruby(DLTK) 5.0 开普勒。我刚刚导入了我现有的 Rails 项目,并看到它与此配合良好。我还在探索它。希望有帮助。
回答by Luís de Sousa
Aptana is largely dysfunctional on Lunaand there is no wholesale alternative. However, combining the following plug-ins one gets a good degree of support:
Aptana在 Luna 上基本上功能失调,没有批发替代品。但是,结合以下插件可以获得很好的支持:
TM Terminal- provides local and remote command line sessions within Eclipse.
Ruby Development Tools- the reference Ruby editor.
JavaScript Development Tools- the base JavaScript editor.
EGit- the Git integration plug-in.
TM Terminal- 在 Eclipse 中提供本地和远程命令行会话。
Ruby Development Tools- 参考 Ruby 编辑器。
JavaScript 开发工具- 基本的 JavaScript 编辑器。
EGit- Git 集成插件。
I run railsand rakein the command line; I also debug through the command line (e.g. using binding.pry). Editing .erbfiles is the trickiest bit, the Ruby editor is ok, but in legacy code I have a great deal of JS in these files; in such cases I use the JavaScript Development tools.
我在命令行中运行rails和rake;我还通过命令行进行调试(例如使用binding.pry)。编辑.erb文件是最棘手的部分,Ruby 编辑器还可以,但是在遗留代码中,我在这些文件中有大量 JS;在这种情况下,我使用 JavaScript 开发工具。
With this setup Eclipse runs considerably lighter than with Aptana.
使用此设置 Eclipse 运行起来比使用 Aptana 轻得多。

