How to use Eclipse for Ruby on Rails (RoR)

梦想的初衷 提交于 2019-12-03 01:56:48

问题


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:

http://rubyonrails.org/download

I found the following Editors 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?


回答1:


To save you some legwork, in Eclipse:

  1. Go to Help -> Install New Software...
  2. Click add (top right of popup)
  3. Enter a Name like "RadRails2"
  4. 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)
  5. Click ok
  6. Restart Eclipse
  7. Go to Window -> Preferences. You will see Ruby is enlisted at left panel

You are done...

Now when you use the "New" menu, you'll have the option to make a Ruby project (among other things).




回答2:


You need to install aptana sudio eclipse plugin and radrails will be included.

refer to this Cannot Install Aptana plugin on Eclipse 4.2




回答3:


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.




回答4:


Aptana is largely dysfunctional on Luna and there is no wholesale alternative. However, combining the following plug-ins one gets a good degree of support:

  • 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.

I run rails and rake in the command line; I also debug through the command line (e.g. using binding.pry). Editing .erb files 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.

With this setup Eclipse runs considerably lighter than with Aptana.



来源:https://stackoverflow.com/questions/12366924/how-to-use-eclipse-for-ruby-on-rails-ror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!