我已经准备好了很多关于S/O的文档和问题,但是我似乎找不到我做错了什么。
给了我一个统一的常数。我已经安装了gem和它的deps,有一个api密钥,并要求'yelp‘在我的代码中存在。
以下是我的错误:
yelp.rb:12:in `<main>': uninitialized constant Yelp::Review (NameError)这是我的密码:
require 'yelp'
client = Yelp::Client.new({ consumer_key: '[struck]',
consumer_secret: '[struct]',
token: '[struck]',
token_secret: '[struck]'
})
city = 'Terre Haute'
req = Yelp::Review::Request::Location.new(
:city => city,
:state => 'IN',
:category => ['coffee', 'potatoes']
)
res = client.search(req)
puts res编辑:我总是忘了愚蠢的东西
发布于 2015-03-03 16:13:58
也许您正在使用这个库https://github.com/Yelp/yelp-ruby,但是您正在跟踪另一个https://github.com/shaper/yelp的文档
它们都具有相似的Client初始化,但官方库没有Review。
https://stackoverflow.com/questions/28833583
复制相似问题