2012-04-29 23 views
0

Rails2アプリケーションがあり、Rails3(プラグイン:https://github.com/rails/rails_upgrade)にアップグレードしようとしています。自動ルートファイルのアップグレード(rails-upgrade)を実行できません

ルートファイルのアップグレードまですべてうまくいきました。私はrake rails:upgrade:routes次のエラーを使用しようとしたときに表示される:

/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake/alt_system.rb:32: Use RbConfig instead of obsolete and deprecated Config. 
    (in /home/chmarus/Pulpit/mmo) 
    WARNING: This version of mysql2 (0.3.11) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1 
    WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x 
    DEPRECATION WARNING: config.action_controller.session= has been deprecated. Please use config.session_store(name, options) instead. (called from <class:Application> at /home/chmarus/Pulpit/mmo/config/application.rb:54) 
    DEPRECATION WARNING: Rake tasks in /home/chmarus/Pulpit/mmo/vendor/plugins/event_calendar/tasks/event_calendar_tasks.rake are deprecated. Use lib/tasks instead. (called from <top (required)> at /home/chmarus/Pulpit/mmo/Rakefile:7) 
    rake aborted! 
    undefined method `now' for nil:NilClass 

    (See full trace by running task with --trace) 

現在のRailsを版:2.3.9 先のver:3.0.3がworng何ですか

?私は何かを逃したかもしれない?たぶんそれはレーキの欠陥ですが、私は確信していません。

編集:すくいレール:アップグレード:ルートは、それはあなたのroutes.rbをファイルを解析するときにエラーが発生していることを

[email protected]:~/Pulpit/mmo$ rake rails:upgrade:routes --trace 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake/alt_system.rb:32: Use RbConfig instead of obsolete and deprecated Config. 
(in /home/chmarus/Pulpit/mmo) 
WARNING: This version of mysql2 (0.3.11) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1 
WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x 
DEPRECATION WARNING: config.action_controller.session= has been deprecated. Please use config.session_store(name, options) instead. (called from <class:Application> at /home/chmarus/Pulpit/mmo/config/application.rb:54) 
DEPRECATION WARNING: Rake tasks in /home/chmarus/Pulpit/mmo/vendor/plugins/event_calendar/tasks/event_calendar_tasks.rake are deprecated. Use lib/tasks instead. (called from <top (required)> at /home/chmarus/Pulpit/mmo/Rakefile:7) 
** Invoke rails:upgrade:routes (first_time) 
** Execute rails:upgrade:routes 
rake aborted! 
undefined method `now' for nil:NilClass 
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:47:in `module_eval' 
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:18:in `draw' 
(eval):1:in `upgrade_routes' 
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:47:in `module_eval' 
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:47:in `upgrade_routes' 
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:28:in `generate_new_routes' 
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/tasks/rails_upgrade_tasks.rake:29:in `block (3 levels) in <top (required)>' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:636:in `call' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:631:in `each' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:631:in `execute' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain' 
/home/chmarus/.rvm/rubies/ruby-head/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:2029:in `each' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:1998:in `run' 
/home/chmarus/.rvm/gems/[email protected]/gems/rake-0.8.7/bin/rake:31:in `<top (required)>' 
/home/chmarus/.rvm/gems/[email protected]/bin/rake:19:in `load' 
/home/chmarus/.rvm/gems/[email protected]/bin/rake:19:in `<main>' 
+0

エラーが発生しているバックトレースを表示できるように--traceを付けて実行できますか? –

+0

最新の質問 – Arti

答えて

1

を--trace。 config/routes.rbのキーワードnowを調べてください。 https://github.com/rails/rails_upgrade/blob/master/lib/routes_upgrader.rb#L38行47を参照してください。

nowへの電話が表示されない場合、またはそこから修正する方法がわからない場合は、質問を編集し、routes.rbファイルを投稿してコメントを残してくださいもっと見る。

+0

をご覧くださいありがとうございます。私の古いroutes.rbファイルには、このクラッシュを引き起こしているカレンダープラグインからの1つのルートがあります。私はそれを削除し、今すぐアップグレードスクリプトが正常に動作しています。 – Arti

+0

awesome :-) good find –