I am trying to upgrade Rails from 2.3 to 3.1. I watched the upgrade video from Railscast but I am having some difficulties.
Steps I followed:
- Create a separate Rails 3 branch from stable branch.
- Update and reload RVM to the latest version.
gem install rails -v 3.0.20.rails upgrade checkandrails upgrade backupusing Rails upgrade plugin.rails new . --skip-active-record
When I start the server I am getting this error:
initializers/new_rails_defaults.rb:13:in `<top (required)>': undefined method `use_standard_json_time_format=' for ActiveSupport:Module (NoMethodError)
Can anyone please help?
The default for
use_standard_json_time_formatchanged between Rails 3.0.20 and 3.1.0 fromfalsetotrue, so depending which version you're aiming for (your question mentions both), you might be able to drop the configuration.If you're cherry-picking ActiveSupport modules, make sure you've required
ActiveSupport::JSON::Encoding, which defines the method.And since
ActiveSupport.use_standard_json_time_formatis just delegating toActiveSupport::JSON::Encoding, you can also try calling it directly on the latter.