开发者

How do I upgrade from Ruby 1.8.7 to Ruby 1.9.2 for Rails 2.3.8 app?

开发者 https://www.devze.com 2023-04-09 17:09 出处:网络
I have searched all over and cannot find anyone with the same problem. I am testing upgrading a large Rails app running Rails 2.3.8 with Ruby 1.9.2 using rvm and nginx+passenger (currently running on

I have searched all over and cannot find anyone with the same problem.

I am testing upgrading a large Rails app running Rails 2.3.8 with Ruby 1.9.2 using rvm and nginx+passenger (currently running on 1.8.7 in production).

I'm using the mysql2 gem, and my database uses UTF-8 encoding. When I login to the app (standard restful-auth), the db lookup finds a match but when the controller tries to save an attribute change on the User model, it raises a validation error from validates_length_of.

I added some debugging output to ActiveRecord and it looks like it thinks all my database record's string values are empty (show up as "[]" in the logs...)

I was seeing the same behavior in script/console: User.first.login => "[]", but it was fixed after switching to the mysql2 gem (and updating database.yml adapter val开发者_开发知识库ue).

Why would the console work but not via the website? ActionController / ActiveSupport bug??

Clarification: This is a stable app that has been live for 1+ years in 1.8.7 with hundreds of specs.


The solution was to disable the xss_terminate plugin.

It is old but was quite useful for me to deal with various user input types and roles.. Obviously hooks way to close to ActiveRecord operations dealing with strings to be useful in Ruby 1.9.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号