I'm making a simple task where I need to parse an XML Http response, all the http is working fine, and I have my xml string....
I'm trying to use the xml-simple
gem.
I've gem install xml-simple
I've also added gem 'xml-simple'
to the gemfile
Ran bundle install
with success
but when I try to require 'xml-simple'
in my rake task it fails saying no such file to load -- xml-simple
...
What am I missing???
run the command bundle install in your shell, once you have your Gemfile created. This command will look your Gemfile and install the relevant Gems on the indicated versions. The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from. Save this answer.
In deployment, isolation is a more important default. In addition, the user deploying the application may not have permission to install gems to the system, or the web server may not have permission to read them. As a result, bundle install --deployment installs gems to the vendor/bundle directory in the application.
There are several ways to specify gem versions: Use a specific version: gem "name-of-gem", "1.0" . You can find specific versions on Rubygems.org (provided that's the source you”re using) by searching for your gem and looking at the “Versions” listed. Use a version operator: gem "name-of-gem", ">1.0" .
Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .
Bundler tries to load the gem by using the gem name as the require path (i.e. require 'xml-simple'
). But in the case of the xml-simple
gem, the path is xmlsimple
, not xml-simple
.
So in your Gemfile, use this instead:
gem 'xml-simple', :require => 'xmlsimple'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With