我正在做一个简单的任务,我需要解析一个XML Http响应,所有的http都工作得很好,并且我有我的xml字符串……
我在试着用xml-simple的宝石。
I‘s gem install xml-simple
我还将gem 'xml-simple'添加到了gemfile中
成功运行bundle install
但是当我尝试在我的rake任务中执行require 'xml-simple'时,它不能显示no such file to load -- xml-simple...
我错过了什么?
发布于 2011-10-08 18:40:41
Bundler试图通过使用gem名称作为请求路径(即require 'xml-simple')来加载gem。但是在xml-simple gem中,路径是xmlsimple,而不是xml-simple。
因此,在您的Gemfile中,请使用以下内容:
gem 'xml-simple', :require => 'xmlsimple'发布于 2011-10-08 13:41:41
gem有时具有与gem名称不同的要求路径,请尝试:
gem 'xml-simple', :require => 'xml/simple'
或
gem 'xml-simple', :require => 'xmlsimple'
或指定正确的所需路径
https://stackoverflow.com/questions/7694972
复制相似问题