2011-06-17 10 views
5

Tengo un problema al ejecutar mi aplicación Rails 3.1.0.rc4 debido a un error o conflicto con will_paginate gem.paginará conflicto Rails 3.1.0.rc4

El error cuando se intenta iniciar el servidor es la siguiente:

/Users/imac/.rvm/gems/[email protected]_3.1/gems/will_paginate-2.3.15/lib/will_paginate.rb:39:in `enable_activerecord': uninitialized constant ActiveRecord::Associations::AssociationCollection (NameError) 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/will_paginate-2.3.15/lib/will_paginate.rb:88:in `<top (required)>' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/bundler-1.0.15/lib/bundler.rb:120:in `require' 
    from /Users/imac/railsprojects/hbg/config/application.rb:12:in `<top (required)>' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/railties-3.1.0.rc4/lib/rails/commands.rb:52:in `require' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/railties-3.1.0.rc4/lib/rails/commands.rb:52:in `block in <top (required)>' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/railties-3.1.0.rc4/lib/rails/commands.rb:49:in `tap' 
    from /Users/imac/.rvm/gems/[email protected]_3.1/gems/railties-3.1.0.rc4/lib/rails/commands.rb:49:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

Respuesta

14

me encuentro con el mismo problema. Parece que este es un problema conocido que se solucionará en breve: https://github.com/mislav/will_paginate/issues/124

Hay parche se puede utilizar en el ínterin: https://github.com/p7r/will_paginate/commit/53d1da6da003dc172ee054e4cc416d0723f00b88

O, mejor aún, utilizar la siguiente línea en el Gemfile:

gem "will_paginate", :git => "https://github.com/p7r/will_paginate.git", :branch => "rails3" 

Espero que responda a tu pregunta.

+1

Dorian eres una estrella del rock, gracias por la información. – chell

+1

Intenté utilizar la instalación de gem como se indicó anteriormente pero me dio este error: Git error: comando 'git clone 'https://github.com/p7r/will_paginate.git'" /Users/imac/.rvm/gems /[email protected]_3.1/cache/bundler/git/will_paginate-2b495351e43ce757e58c441df29c3ef5594a0cfd "--bare --no-hardlinks' en el directorio/Users/imac/railsprojects/hbg ha fallado. alguna idea? – chell

+1

Seguí las instrucciones en el parche y funcionó. Gracias de nuevo :) – chell