RubyMine Ruby Libraries not recognized by the application

I am creating a simple application to read RSS feeds. The project already contains the libraries folder which is added by default and which contains all the necessary libraries. For some reason when I type the following:

require 'rss'

I get the following error when the application is executed:



C:\IronRubyProjects\IronRubyTaskListApplication>ir rss_reader_form.rb
:0:in `require': no such file to load -- rss (LoadError)
        from rss_reader_form.rb:3



5 comments
Comment actions Permalink

I think you should add your 'lib' folder to load path. E.g


# rss_reader_form.rb

$: << File.dirname(__FILE__) + "/lib"

# ... other code ...



0
Comment actions Permalink

But there is already a default "Libraries" folder in my RubyMine Ruby Project. RubyMine created that Libraries folder which contains all the libraries for Ruby. Do I manually have to copy the rss module from the Libraries folder to my custom "libs" folder? If yes, then what is the purpose of the libraries folder which is created by default by RubyMine?

0
Comment actions Permalink

azamsharp wrote:

But there is already a default "Libraries" folder in my RubyMine Ruby Project. RubyMine created that Libraries folder which contains all the libraries for Ruby. Do I manually have to copy the rss module from the Libraries folder to my custom "libs" folder? If yes, then what is the purpose of the libraries folder which is created by default by RubyMine?

"Libraries" folder which is shown in RubyMine's Project view isn't real folder on a disk. This is just presentation of gems which RubyMine uses for code insight features(resolve/completion). You can look at this list and add("attach") in File | Settings | RubySDK and Gem Manager.

0
Comment actions Permalink

I have still not resolved this issue:

I am having problems with 'open-uri' library. I found the open-uri library and I have placed it in my libs folder. When I say ir myapp.rb it says uri is not found. Why it is not able to locate uri module?

When I manually add 'uri' to my libs folder it says it is already added.



C:\IronRubyProjects\IronRubyTaskListApplication>ir rss_reader_form.rb
:in `require': no such file to load -- uri (LoadError)
        from ./libs/open-uri.rb:1
        from rss_reader_form.rb:3
        from :in `require'



0
Comment actions Permalink

I am having problems with 'open-uri' library. I found the open-uri library and I have placed it in my libs folder. When I say ir myapp.rb it says uri is not found. Why it is not able to locate uri module?


When I manually add 'uri' to my libs folder it says it is already added.


C:\IronRubyProjects\IronRubyTaskListApplication>ir rss_reader_form.rb
:in `require': no such file to load -- uri (LoadError)
        from ./libs/open-uri.rb:1
        from rss_reader_form.rb:3
        from :in `require'


Have you add  $: << File.dirname(__FILE__) + "/lib" string to the beginning of rss_reader_form.rb file?

0

Please sign in to leave a comment.