Ruby on Rails: no implicit conversion of Array into String (DEVISE)

白昼怎懂夜的黑 提交于 2019-11-29 08:49:17
kibaekr

Thank you guys for the answers! So it seems like it was a problem with the sessions that was causing the error..

I was able to solve this by following Devise upgrade from 1.1.5 to 1.4.5 causes Wrong Number of Arguments error

I ran rake tmp:clear and changed the name of the key in the session_store.rb file.

Wow I spent 14 hours trying to solve this issue and it turns out there was such an easy solution..

It appears that both of the following in your code are evaluating arrays:

if current_user
if affiliate

Calling if on an array will give you this error.

I am unsure why you would have current_user as an array unless you are setting it somewhere else in your code, check anywhere you have current_user =

For affiliate, find_by_token is returning an array, perhaps try one of the following:

if affiliate.present?
if !affiliate.nil?
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!