Gem is not available, even after adding to the gemfile and running the package

I am doing a simple task when I need to parse an XML Http response, all http works fine, and I have an xml string ....

I am trying to use xml-simple stone.

I gem install xml-simple

I also added gem 'xml-simple' to gemfile

Ran bundle install with success

but when I try to execute require 'xml-simple' in my rake task, it says no such file to load -- xml-simple ...

What am I missing ???

+4
source share
2 answers

The Bundler attempts to load the gem using the name of the gem as the required path (i.e. require 'xml-simple' ). But in the case of the xml-simple xmlsimple , the path is xmlsimple , not xml-simple .

So in your gemfile use this instead:

 gem 'xml-simple', :require => 'xmlsimple' 
+6
source

Gems sometimes have a different path required than the name of the gem, try either:

gem 'xml-simple', :require => 'xml/simple'

or

gem 'xml-simple', :require => 'xmlsimple'

or something that is needed for the right way to indicate

0
source

All Articles