will paginate conflict Rails 3.1.0.rc4
Asked Answered
A

1

5

I am having a problem gettin my Rails 3.1.0.rc4 application running because of an error or conflict with will_paginate gem.

The error produced when I try to start the server is as follows:

/Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_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/ruby-1.9.2-p180@hbg_3.1/gems/will_paginate-2.3.15/lib/will_paginate.rb:88:in `<top (required)>'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_3.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_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/ruby-1.9.2-p180@hbg_3.1/gems/railties-3.1.0.rc4/lib/rails/commands.rb:52:in `require'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_3.1/gems/railties-3.1.0.rc4/lib/rails/commands.rb:52:in `block in <top (required)>'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_3.1/gems/railties-3.1.0.rc4/lib/rails/commands.rb:49:in `tap'
    from /Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_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>'
Adinaadine answered 17/6, 2011 at 8:1 Comment(0)
C
14

I run into the same problem. It seems that this is a known issue that will be fixed soon : https://github.com/mislav/will_paginate/issues/124

There is patch you can use in the meantime : https://github.com/p7r/will_paginate/commit/53d1da6da003dc172ee054e4cc416d0723f00b88

Or, better yet, use the following line in your Gemfile:

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

Hope this answers your question.

Caper answered 17/6, 2011 at 15:31 Comment(2)
I tried to user the gem install as stated above but it gave me this error:Git error: command git clone 'https://github.com/p7r/will_paginate.git' "/Users/imac/.rvm/gems/ruby-1.9.2-p180@hbg_3.1/cache/bundler/git/will_paginate-2b495351e43ce757e58c441df29c3ef5594a0cfd" --bare --no-hardlinks in directory /Users/imac/railsprojects/hbg has failed. any ideas?Adinaadine
I followed the directions in the patch and that worked. Thanks again :)Adinaadine

© 2022 - 2024 — McMap. All rights reserved.