我的雅虎联系人导入OmniContacts gem总是失败

我正在使用OmniContacts gem将联系人从yahoo和gmail导入我的应用程序。 现在雅虎import商停止工作了。

我的控制器上有以下操作:

def contacts_callback @contacts = request.env['omnicontacts.contacts'] @importer = params[:importer] if session[:draw_token] @draw_token = session[:draw_token] end end def import_failed if session[:draw_token] draw = Draw.find_by_token(session[:draw_token]) if draw != nil session[:draw_token] = nil redirect_to dashboard_draw_url(draw) else session[:draw_token] = nil redirect_to root_path, alert: _('Draw not exists.') end else redirect_to dashboard_show_invitation_email_friendship_url, alert: _('You have canceled the request.') end end 

路线:

  get '/contacts/:importer/callback' => 'dashboard/invitation_email#contacts_callback' get '/contacts/failure' => 'dashboard/invitation_email#import_failed' 

但是当我尝试从雅虎导入时,我总是进入import_failed操作,我无法理解为什么。

有没有人知道问题是什么。

提前致谢

这是一个老问题,但我会回答它,所以你可以关闭它

首先,您需要使用最新版本的OmniContacts,在旧版本中,它不使用https,这是雅虎所要求的。 [资源]

其次,你应该查看你的控制台日志,你可能会看到类似这样的错误:

不允许使用自定义端口,或者未使用此使用者密钥注册主机。

这可能意味着您正在使用类似于此的回调URL(典型的RoR)

 http://localhost:3000/contacts/callback 

雅虎不允许指定端口。 以下是Yahoo Dev的讨论和解决方法 。