How to configure Ruby intepreter for Eclipse How to configure Ruby intepreter for Eclipse ruby ruby

How to configure Ruby intepreter for Eclipse


I started my ruby project in eclipse Indigo in Ubuntu 12.04 and have the same problem. If you installed ruby already and can create a ruby project in eclipse, then you can find/add interpreters by the following way:

  1. Go to Window -> Preferences > Ruby > Interpreters
  2. Click on Search button on the right, then eclipse will help you to find the ruby interpreters
  3. Click OK button at the bottom

For my case, the location of the interpreter is /usr/bin/ruby


Without RVM :

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.

With RVM :

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!


Prerequisite: Installation of Ruby

Configuration of Ruby Interpreter in Eclipse:

  1. Open eclipse
  2. Install the Ruby plugin for Eclipse (in my case, it is DLTK)
  3. Go to Window -> Preferences
  4. Click Ruby-> Interpreters from left panel
  5. Click Search... button at right side (Eclipse will help you to find the ruby interpreters)
  6. Click OK button at the bottom

Now you are ready to create new Ruby project and run.