scattrbrain
Darshan Patil's personal blog
mysql.rb errors after upgrading ruby 7
I just noticed that my rails projects broke after I upgraded ruby on my linux box. Projects that had gems and rails frozen break. This is because of code in the SHA1 class not being backward compatible.
To quickly fix a broken rails app that shows the following error:vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:551:in `initialize'
edit the mysql.rb file so that the scramble41 routine looks like:
def scramble41(password, message)
return 0x00.chr if password.nil? or password.empty?
buf = [0x14]
s1 = Digest::SHA1.digest(password)
s2 = Digest::SHA1.digest(s1)
x = Digest::SHA1.digest(message + s2)
(0..s1.length - 1).each {|i| buf.push(s1[i] ^ x[i])}
buf.pack("C*")
endTrackbacks
Use the following link to trackback from your own site:
http://scattrbrain.com/articles/trackback/186















Man you don’t even know how long I’ve waited for this since disabling my own Movable Type widget (that doesn’t work since Haloscan bypasses that code).
THANK YOU!
aaaaaaaaaaaaa, man, I had the same problem! I’m not alone! :)
Thanke you so much!
I tried this but now I get a different error: MySQL Connection dropped during query….anyone see anything like that? What version of Ruby did you upgrade to that caused this error?
I was installing Mephisto and hit this – voila!
Thank you!
Like the rest, thanks.
worked!