[英]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.