"can't convert string into integer" error in crypt/blowfish in rails3

336 Views Asked by At

Migrating an application from rails2 to rails3 and i am facing an error can't convert String into Integer in crypt/blowfish.

config/core_ext/string.rb file:

def encrypt(key) <br/>
  blowfish = Crypt::Blowfish.new(key)
  blowfish.encrypt_string(self)
end

The method called from test/unit/core_ext/string_test.rb

def test_encryption
  key = "test"
  encrypted = str.encrypt(key)
end

How to fix this issue? Any help would be appreciated.

1

There are 1 best solutions below

0
On

Apparently there are problems with Blowfish in Ruby 1.9+. You can update the blowfish gem or use gist.