rails-upgrade - 将rails2应用程序升级到rails3

时间:2011-07-12 05:36:24

标签: ruby-on-rails-3 upgrade

我在rails2中有一个现有项目,我需要将它升级到rails3。

我听说有关rails-upgrade的内容但尚未使用。

当我尝试使用rails-upgrade check时,会产生如下错误:

$ rails-upgrade check
/usr/lib/ruby/gems/1.8/gems/rails-upgrade-0.0.2/lib/rails-upgrade/upgraders/routes.rb:28: undefined method `cattr_accessor' for RailsUpgrade::Upgraders::RouteRedrawer:Class (NoMethodError)
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
    from /usr/lib/ruby/gems/1.8/gems/rails-upgrade-0.0.2/lib/rails-upgrade.rb:12
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
    from /usr/lib/ruby/gems/1.8/gems/rails-upgrade-0.0.2/bin/rails-upgrade:7
    from /usr/bin/rails-upgrade:19:in `load'
    from /usr/bin/rails-upgrade:19

任何人请告诉我如何将我的应用程序升级到rails3。

1 个答案:

答案 0 :(得分:0)

我通过在旧版本中创建一个新的rails项目来进行rails升级。

在创建过程中,您应该检查应该覆盖的文件之间的区别。

对我而言,这是更新我的rails项目的最快方法。