[英]undefined method `company_search' for LinkedIn API with linkedin-oauth2 gem
我想在Ruby on Rails項目中搜索具有LinkedIn API的公司。
我使用linkedin-oauth2 gem來執行此操作,但是當我嘗試任何公司搜索時,都會出現此錯誤。
undefined method `company_search' for #<LinkedIn::API:0x007f88aad68bb8>
這是我的代碼:
api = LinkedIn::API.new(access_token)
@companies = api.company_search(
keyword: "technologies",
facets: "location,industry",
facet: ["location,us","industry,4"],
start: 0,
count: 1000000
)
如果您想使用方法( company_search
)供自己使用
gem 'linkedin-oauth2', github: 'emorikawa/linkedin-oauth2', branch: 'master'
在您的Gemfile
然后bundle install
但使用推薦的穩定版本的gem
似乎您正在使用該寶石的舊版本。 該方法在2015年3月添加 ,尚未發布。
因此,您應該使用master
最新版本的gem:
gem 'linkedin-oauth2', github: 'emorikawa/linkedin-oauth2', branch: 'master'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.