0

je mise à niveau d'une application Rails 2 à Rails 3, quand j'exécute rails console il lance ceci:méthode non définie retour » pour WillPaginate: Module

$ rails c production 
/usr/lib/ruby/gems/1.8/gems/will_paginate-2.3.12/lib/will_paginate.rb:39:in `enable_activerecord': undefined method `returning' for WillPaginate:Module (NoMethodError) 
    from /usr/lib/ruby/gems/1.8/gems/will_paginate-2.3.12/lib/will_paginate.rb:88 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `each' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler.rb:120:in `require' 
    from /home/neoriddle/proyectos/interkids/config/application.rb:7 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/commands.rb:21:in `require' 
    from /usr/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/commands.rb:21 
    from script/rails:6:in `require' 
    from script/rails:6 

Comment puis-je résoudre ce problème?

Répondre

3

Mise à jour will_paginate gem. Le procédé #returning a été déprécié en faveur de la méthode #tap. On dirait que l'ancienne version de la gemme will_paginate que vous utilisez utilise toujours cette méthode obsolète.

0

Oui, c'était vrai.

Voici mes détails ...

je change en Gemfile cette ligne:

gem 'will_paginate', '2.3.12' 

avec cette ligne:

gem 'will_paginate', '>=3.0.pre' 

Puis je mets à jour Gemfile.lock avec ceci:

bundle update will_paginate 

Et je reçois ceci:

$ bundle update will_paginate 
Fetching source index for http://rubygems.org/ 
... 
Installing will_paginate (3.0.2) 
Updating .gem files in vendor/cache 
    * will_paginate-3.0.2.gem 
Removing outdated .gem files from vendor/cache 
    * will_paginate-2.3.12.gem 
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed. 

et cette erreur ont été résolus.

Questions connexes