Some Tips for Upgrading to Rails 1.2.x

Bellow are some issues that I met when upgraded from rails 1.1.6 to 1.2.x:

1.About enrivonment.rb
Make sure your application configuration behind:

Rails::Initializer.run do |config|
  ...
end

I met this issue when I put following code:

require 'environments/localization_environment'
require 'localization'
Localization::load_localized_strings
require 'environments/user_environment'

before that closure, which works under 1.1.6, but don't under 1.2.x

2.About ActionMailer::Base.server_settings
If you get errors like:

uninitialized constant ActiveSupport::Deprecation::RAILS_DEFAULT_LOGGER (NameError)

try to change your ActionMailer::Base.server_settings to ActionMailer::Base.smtp_settings

3.Put all "include" statements inside class definitions
You must put include statements inside class/module definitions instead of outside a class/module definition in Rails 1.2.x. Otherwise, you'll get:

Error calling Dispatcher.dispatch #<NameError: cannot remove Object::COPYRIGHT>

你可能感兴趣的:(Rails)