With the latest stable release of rails out the door for about a month, we’ve had a chance to upgrade the bulk of the applications we maintain to 126.96.36.199. The rails 2.3 release notes were a HUGE help during this upgrade. Thanks to the Mike Gunderloy for compiling that document.
Here are some gotchas, aka issues, aka roadblocks to Strategic Enterprise Adoption that we discovered while upgrading some of them.
Problem: ‘const_missing’: uninitialized constant CGI::Session (NameError)
Solution: Hoptoad Notifier plugin needs to be updated.
ruby script/plugin install --force git://github.com/thoughtbot/hoptoad_notifier.git
Problem: You see
'load_missing_constant': uninitialized constant
Solution: You need to rename
@request.cookies["name"] = CGI::Cookie.new("name", "value") sets the
cookie to [value] instead of value.
Solution: You no longer need to set the cookie to a
Just set it to the string directly:
@request.cookies["name"] = "value".
Problem: You see an
undefined method 'use_transactional_fixtures=' for
Solution: In your
test/test_helper.rb file, you need to rename
ActiveSupport::TestCase to set these options.
Problem: You see `NoMethodError: undefined method ‘assert_recognizes’ for
Solution: Are you testing your routes in a unit test with a class of
ActiveSupport::TestCase? The routing assertions are only included in
ActionController::TestCase now, so change the test class to use that instead.
Problem: errors on a
#count that goes through a
named_scope on a
:through. This used to successfully proxy through and run a successful
COUNT query. Now there’s all this.
Solution: not sure yet, maybe use the file at the end of that ticket?
Problem: when you deploy to staging or production, you get an error about an
reenable method on
Solution: This method was introduced in rake 0.8.2, but not actually used by rails prior to the 2.3 release. You need to update rake to a version newer than 0.8.2 on your servers (0.8.4 is latest stable as of now).
Problem: When deploying you get an undefined method
Solution: Upgrade rubygems to the latest stable version (1.3.1 at the time of this post).