0
我已經準備好了很多關於S/O的文檔和問題,但我似乎無法找到我做錯了什麼。Yelp API Unitialized Constant
Yelp給了我一個統一的常量。我已經安裝了寶石,它的代碼,有一個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
編輯:我總是忘了愚蠢的東西-_-