I installed Dynamic Languages Toolkit for Ruby plugin in eclipse and it is not working:
Details:
- Eclipse version: Eclipse 4.2.2
- OS Details: Ubuntu 10.04
- Ruby version: ruby 1.9.2p180
THis is my ruby code:
# cat array.rb
#!/usr/bin/ruby
require "awesome_print"
hash = {
:name => "your_self",
:place => ["where", "somewhere"],
}
ap hash
and here is the ERROR when this is run from eclipse:
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- awesome_print (LoadError)
HOwever, I can run this code from console manually and it gives me the output:
# ruby array.rb
{
:name => "your_self",
:place => [
[0] "where",
[1] "somewhere"
]
}
Needless to say, I do have awesome_print
gem installed:
# gem list | grep awesome
awesome_print (1.2.0)
In Eclipse, I do have ruby interpreter set as below:
QUESTION: This issue is seen only when I use require
in my code. Otherwise Eclipse can run the ruby code fine. What am I missing in my eclipse?
UPDATE:
If I use:
require "/usr/local/lib/ruby/gems/2.0.0/gems/awesome_print-1.2.0/lib/awesome_print.rb"
then Eclipse is able to run the code fine. So I think this has something to do with ruby/eclipse search path
of something.