我安装了ruby-aaws gem,我试图运行一个示例脚本。我收到以下错误。有什么我想念的吗?谢谢。
<div ng-repeat= "item in searchData">
<tr ng-repeat= "itm in item">
<td>{{itm.profileInfo.firstname}}</td>
<td> {{itm.profileInfo.country}}</td>
</tr>
<div>
- 醇>
(ERROR)
$ ruby amazon.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
1. gem install ruby-aaws 2. amazon.rb require 'amazon/aws' require 'amazon/aws/search' include Amazon::AWS include Amazon::AWS::Search ASSOCIATES_ID = "************" KEY_ID = '**************' il = ItemLookup.new( 'ASIN', { 'ItemId' => 'B001COU9I6', 'MerchantId' => 'Amazon' }) rg = ResponseGroup.new( 'Medium' ) req = Request.new(KEY_ID, ASSOCIATES_ID) resp = req.search( il, rg) item_sets = resp.item_lookup_response[0].items item_sets.each do |item_set| item_set.item.each do |item| attribs = item.item_attributes[0] puts attribs end end
需要&#39; 来自/Library/Ruby/Gems/2.0.0/gems/ruby-aaws-0.8.1/lib/amazon/aws.rb:12:inrequire': cannot load such file -- iconv (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
&#39; 来自/Library/Ruby/Gems/2.0.0/gems/ruby-aaws-0.8.1/lib/amazon/aws.rb:5:in<module:AWS>' from /Library/Ruby/Gems/2.0.0/gems/ruby-aaws-0.8.1/lib/amazon/aws.rb:7:in
需要&#39; 来自/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in
需要&#39; 来自amazon.rb:7:在`&#39;
答案 0 :(得分:4)
您的系统中缺少iconv
,或者您的版本与其他软件包的要求不符。
iconv
iconv --version
或
which iconv
iconv
gem gem install iconv
或
rvm pkg install iconv
gem install iconv -v '~> 1.0.3'