Please require this file from within a Capistrano recipe (LoadError) - ruby-on-rails-3

I'm using Capistrano 2 with Rails 3 project. Recently I rebuilt my gemset form scratch and now I receive error "Please require this file from within a Capistrano recipe (LoadError)" when I try to run rails server.
Detailed error message:
/Users/leonidlukin/.rvm/rubies/ruby-1.9.3-p429/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/leonidlukin/Sites/moscowshows/script/rails server -b 0.0.0.0 -p 3000 -e development
/Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:18:in `instance': Please require this file from within a Capistrano recipe (LoadError)
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/base.rb:16:in `rvm_with_capistrano'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/_cset.rb:3:in `<top (required)>'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/base.rb:1:in `<top (required)>'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/selector.rb:1:in `<top (required)>'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano.rb:3:in `<top (required)>'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:85:in `require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:85:in `rescue in block in require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:68:in `block in require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:61:in `each'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:61:in `require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/bundler-1.8.0/lib/bundler.rb:134:in `require'
from /Users/leonidlukin/Sites/moscowshows/config/application.rb:13:in `<top (required)>'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429#moscowshows/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from /Users/leonidlukin/Sites/moscowshows/script/rails:6:in `require'
from /Users/leonidlukin/Sites/moscowshows/script/rails:6:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
Which file I should require from within a Capistrano recipe?

The problem is with rvm-capistrano.
Correct it in gemfile. require: false
gem 'rvm-capistrano', require: false
This should help

A better solution I found, instead of removing it, to just move rvm-capistrano before capistrano:
# Deploy with Capistrano
gem 'rvm-capistrano'
gem 'capistrano'
gem 'capistrano-ext'

But, what's strange, I've solved this problem also like that (in my Gemfile, just to comment main capistrano gem):
# Deploy with Capistrano
# gem 'capistrano', :group => :development
gem 'rvm-capistrano', :group => :development

In your Gemfile change this.
gem 'rvm-capistrano', require: false
This will solve the problem without any headache.

Related

Can't start rails server after aws-sdk-3 installed

I know that there is a lot of such kind of questions, but still, I believe my case is slightly different.
I recently decided to build in an AWS-S3 gem to my rails version 3 project (RUBY_VERSION - 1.9.2p320).
After the successfully aws-sdk gem have been installed, I've got an error message on rails server
/root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/aws-sdk-core-3.78.0/lib/seahorse/client/net_http/patches.rb:26:in `alias_method': undefined method `new_transport_request' for class `Net::HTTP' (NameError)
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/aws-sdk-core-3.78.0/lib/seahorse/client/net_http/patches.rb:26:in `apply!'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/aws-sdk-core-3.78.0/lib/seahorse/client/net_http/connection_pool.rb:10:in `<top (required)>'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/aws-sdk-core-3.78.0/lib/seahorse.rb:34:in `require_relative'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/aws-sdk-core-3.78.0/lib/seahorse.rb:34:in `<top (required)>'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in `require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in `block in require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:597:in `new_constants_in'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:225:in `load_dependency'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in `require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/aws-sdk-core-3.78.0/lib/aws-sdk-core.rb:2:in `<top (required)>'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in `require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in `block in require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:597:in `new_constants_in'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:225:in `load_dependency'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in `require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/aws-sdk-resources-3.59.0/lib/aws-sdk-resources.rb:1:in `<top (required)>'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in `require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in `block in require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:597:in `new_constants_in'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:225:in `load_dependency'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/activesupport-3.0.19/lib/active_support/dependencies.rb:242:in `require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/aws-sdk-3.0.1/lib/aws-sdk.rb:1:in `<top (required)>'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `block in require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `each'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:120:in `require'
from /jasa/api/trunk/config/application.rb:7:in `<top (required)>'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/railties-3.0.19/lib/rails/commands.rb:28:in `require'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/railties-3.0.19/lib/rails/commands.rb:28:in `block in <top (required)>'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/railties-3.0.19/lib/rails/commands.rb:27:in `tap'
from /root/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/railties-3.0.19/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I've tried both
gem 'aws-sdk', '~> 3'
and
gem 'aws-sdk-s3', '~> 1'
I've checked the referred module in github, but got hothing to catch on.
What am I doing wrong?
Thanks a lot. Any help will be appreciated.
I think it's clear based on referred module that you posted in your question. If you see the code new_transport_request method is defined in module Ruby_2 (line 30) and module Ruby_1_9_3 (line 83) and then if you see line 19 to 24 :
if RUBY_VERSION >= '2.0'
Net::HTTP.send(:include, Ruby_2)
Net::HTTP::IDEMPOTENT_METHODS_.clear
elsif RUBY_VERSION >= '1.9.3'
Net::HTTP.send(:include, Ruby_1_9_3)
end
there is no if condition for ruby 1.9.2. In conclusion the issue is not coming from Ruby or Rails but from the gem that does not support ruby 1.9.2.
You might just need to upgrade the ruby to 1.9.3 and it should fix this issue. Furthermore ruby 1.9.2 is no longer maintained so it's good idea to upgrade to avoid security vulnerability. I hope it's help.
Thank you.
I'd start with an update to the latest rails, but incrementally, of course. ActiveStorage feature changes and the latest gem. No telling what went south since Rails 3

LoadError: cannot load such file -- test/unit/error

I am trying to install insoshi in Rails 3.2.21 with ruby 1.9.3 every thing gone good but now I am stopped with an error when I try $rake gems:install it gives an error
rake aborted!
LoadError: cannot load such file -- test/unit/error
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
53:in `block in require'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
21:in `new_constants_in'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
53:in `require'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/deprecation.rb:22
4:in `<top (required)>'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
53:in `block in require'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:5
21:in `new_constants_in'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support/dependencies.rb:1
53:in `require'
C:/Sites/insoshi/vendor/rails/activesupport/lib/active_support.rb:37:in `<top (r
equired)>'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/misc.rake:11:in `<top (required
)>'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/rails.rb:4:in `load'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/rails.rb:4:in `block in <top (r
equired)>'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/rails.rb:4:in `each'
C:/Sites/insoshi/vendor/rails/railties/lib/tasks/rails.rb:4:in `<top (required)>
'
C:/Sites/insoshi/Rakefile:10:in `<top (required)>'
(See full trace by running task with --trace)
I am totally new with rails. hope for help
Try adding following gem into your gem file
gem 'test-unit'
Hope it will solve your problem.

uninitialized constant Capistrano (NameError)

rvm 1.14.5, rvm-capistrano (1.2.2) and capistrano (2.12.0)
My Gemfile is :
group :development, :test do
gem 'rvm-capistrano'
gem 'capistrano'
end
When I try to start passenger, I keep seeing this error :
[ pid=4691 thr=76294140 file=utils.rb:176 time=2012-07-04 11:37:06.179 ]: *** Exception NameError in PhusionPassenger::Rack::ApplicationSpawner (uninitialized constant Capistrano) (process 4691, thread #<Thread:0x9184ff8>):
from /home/ved/.rvm/gems/ruby-1.9.3-p194/gems/rvm-capistrano-1.2.2/lib/rvm/capistrano.rb:3:in `<top (required)>'
from /home/ved/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:74:in `require'
from /home/ved/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:74:in `rescue in block in require'
from /home/ved/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:62:in `block in require'
from /home/ved/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
from /home/ved/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
from /home/ved/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
from /home/ved/rails_projects/grabber/config/application.rb:12:in `<top (required)>'
from /home/ved/rails_projects/grabber/config/environment.rb:3:in `require'
from /home/ved/rails_projects/grabber/config/environment.rb:3:in `<top (required)>'
from config.ru:3:in `require'
from config.ru:3:in `block in <main>'
Just taking a stab here, but make sure that you are excluding the development and test group when your bundle is installed.
bundle install --without test development
It sounds like for some reason your application is trying to load rvm-capistrano.

could not run generate statements after installing rails plugin

I tried installing the paperclip plugin from my rails project root directory, by
rails plugin install http://github.com/thoughtbot/paperclip.git
vendor/plugins/paperclip was created successfully. But after that i could not run any generate (rails generate scaffold ) commands . I'm getting error as
D:\rr\pr2>rails g scaffold car name:string
D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/active_support/d
ependencies.rb:240:in `require': no such file to load -- cocaine (LoadError)
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:240:in `block in require'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:223:in `block in load_dependency'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:640:in `new_constants_in'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:223:in `load_dependency'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:240:in `require'
from D:/rr/pr2/vendor/plugins/paperclip/lib/paperclip.rb:45:in `<top (re
quired)>'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:240:in `require'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:240:in `block in require'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:223:in `block in load_dependency'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:640:in `new_constants_in'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:223:in `load_dependency'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.0/lib/act
ive_support/dependencies.rb:240:in `require'
from D:/rr/pr2/vendor/plugins/paperclip/init.rb:1:in `block in <class:Pl
ugin>'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/pl
ugin.rb:80:in `eval'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/pl
ugin.rb:80:in `block in <class:Plugin>'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/in
itializable.rb:25:in `instance_exec'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/in
itializable.rb:25:in `run'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/in
itializable.rb:50:in `block in run_initializers'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/in
itializable.rb:49:in `each'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/in
itializable.rb:49:in `run_initializers'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/ap
plication.rb:92:in `initialize!'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/ra
iltie/configurable.rb:30:in `method_missing'
from D:/rr/pr2/config/environment.rb:5:in `<top (required)>'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/ap
plication.rb:78:in `require'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/ap
plication.rb:78:in `require_environment!'
from D:/sprtcr/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/co
mmands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
By installing this gem as a plugin, you're not going to get the dependencies that the gem requires. The paperclip gem depends on another gem called cocaine.
I would really recommend installing the paperclip gem by putting it into your Gemfile and running bundle install.
This is why you should use gems rather than plugins.

will paginate conflict Rails 3.1.0.rc4

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>'
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.