3
我在rails2中有一個現有項目,我需要將它升級到rails3。rails-upgrade - 將rails2應用升級到rails3
我聽說了一些關於rails升級但尚未使用的東西。
當我試圖用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中。
'cattr_accessor'在'ActiveSupport' v 3+中定義您是否安裝了rails v 3+或者這個gem? – Bohdan
@Bohdan Pohorilets: '$ gem list | grep activesupport' 'activesupport(3.0.9,3.0.7,3.0.5,3.0.4,3.0.3,2.3.8,2.2.2)' 仍然是同樣的問題 – Sayuj
嘗試刪除舊的寶石,也有一個類似的線程http://www.ruby-forum.com/topic/59288,並有建議運行'export RUBYOPT = -rubygems' – Bohdan