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

后端 未结 2 672
余生分开走
余生分开走 2020-12-18 16:22

I recently upgraded to OSX Mavericks 10.9 from 10.7, and since then it has been causing me lots of troubles. I upgraded Xcode, Command line tools, reinstalled homebrew and r

相关标签:
2条回答
  • 2020-12-18 16:51

    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?
    
    0 讨论(0)
  • 2020-12-18 16:53

    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..

    0 讨论(0)
提交回复
热议问题