test 代码如下
require "lib/TaoBaoApi.rb"
urls=[
'http://detail.tmall.com/item.htm?id=41209779482',
'http://detail.tmall.com/item.htm?spm=a1z0d.6639537.1997196601.23.amSsBp&id=44277933187',
'http://detail.tmall.com/item.htm?id=5779313009'
]
urls.each {|url|
good = TaoBaoApi::Good.new url
info = good.get_info
p info
puts get_url
}
TaoBaoApi 已经安装 但是 每次运行 ruby test.rb 就报这个错误,不知道何故,之前没有报错过,ruby 版本 2.2.2
/Users/david/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- TaoBaoApi/version (LoadError)
from /Users/david/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/david/work/shanyeshuo/vendor/TaoBaoApi/lib/TaoBaoApi.rb:1:in `<top (required)>'
from /Users/david/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/david/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from test.rb:1:in `<main>'