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:
- Go to Window -> Preferences > Ruby > Interpreters
- Click on Search button on the right, then eclipse will help you to find the ruby interpreters
- 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:
- Open eclipse
- Install the Ruby plugin for Eclipse (in my case, it is DLTK)
- Go to Window -> Preferences
- Click Ruby-> Interpreters from left panel
- Click Search... button at right side (Eclipse will help you to find the ruby interpreters)
- Click OK button at the bottom
Now you are ready to create new Ruby project and run.