0
使用此itunes search寶石,並且文檔看起來非常簡單。它失敗 與iTunes搜索紅寶石:未初始化的常量Itunes
NameError: uninitialized constant Itunes
gem install itunes-search
Usage
base = Itunes::Base.new
search_object = base.search("term"=>"The Killers")
# get an array of the search_objects
results = search_object.results
results.each do |result|
puts result.trackViewUrl
end
puts result.attributes
這裏是我的代碼
$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'itunes-search'
=> true
irb(main):003:0> base = Itunes::Base.new
NameError: uninitialized constant Itunes
from (irb):3