BCrypt::Errors::InvalidSalt: invalid salt Devise

前端 未结 2 1279
后悔当初
后悔当初 2021-01-24 21:04

I\'m getting this error when i try to create new User, like this

>> User.create(:email=>\"nandosousafr@gmail.com\", :password => \"hello\")
BCrypt::E         


        
相关标签:
2条回答
  • 2021-01-24 21:50

    What if you tried reinstalling the bcrypt-ruby gem?

      # Remove all versions of bcrypt-ruby
      sudo gem uninstall bcrypt-ruby
    
      # Install the latest version 
      sudo gem install bcrypt-ruby
    
    0 讨论(0)
  • 2021-01-24 21:55

    Reinstalling bcrypt-ruby hasn't worked for me.

    The bug got fixed in bcrypt-ruby >= 3.1.10, but Rails 3.2 locked on bcrypt-ruby 3.0.x.

    Solution would be to either:

    • move to newer Rails version (>=4)
    • use older Ruby version (2.1.x)
    • fork my changes and keep up with security updates by yourself (since currently Rails 3.2 supports only severe security updates)
    0 讨论(0)
提交回复
热议问题