Rails 3.2 ActionMailer Demo Failing - ruby-on-rails-3

I've been using rails 3 for quite a while, but I haven't had to use ActionMailer until now. I followed the guide and expected it to work out of the box. However, it appears that I've hit some error that lies deeply inside internal rails code. Unfortunately, I can't find any mention of this error, which I'm guessing must be do to configuration.
My mailer class is:
class UserMailer < ActionMailer::Base
default :from => "notifications#example.com"
def welcome_email
#url = "http://example.com/login"
mail(:to => "test#example.com", :subject => "Welcome to My Awesome Site")
end
end
When I try to use the mailer I get:
UserMailer.welcome_email
NoMethodError: undefined method `protected_instance_variables=' for ActionController::Base:Class
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/metal/compatibility.rb:22:in `block in <module:Compatibility>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/concern.rb:117:in `class_eval'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/concern.rb:117:in `append_features'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:232:in `include'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:232:in `<class:Base>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:171:in `<module:ActionController>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_controller/base.rb:3:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_view/test_case.rb:11:in `<class:TestCase>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_view/test_case.rb:10:in `<module:ActionView>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.1/lib/action_view/test_case.rb:8:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/prototype-rails-3.2.1/lib/prototype-rails/on_load_action_view.rb:17:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:234:in `block in load_dependency'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:234:in `load_dependency'
... 23 levels...
from /users/user/Documents/element/app/mailers/user_mailer.rb:1:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:469:in `load'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:469:in `block in load_file'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:468:in `load_file'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:353:in `require_or_load'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:502:in `load_missing_constant'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:192:in `block in const_missing'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `each'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:190:in `const_missing'
from (irb):1
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start'
from /Users/user/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.1/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I'm using rails 3.2.1. I saw some mention of protected_instance_variables= being deprecated, which could maybe explain why it isn't defined for ActionController::Base. But, that seems like it would be a rails bug, and I would imagine that ActionMailer has been well tested. Anyone have any ideas?
Thanks

I had experienced a similar error on starting my rails 3.2.1 application--removing the prototype-rails gem solved it for me.
Of course I happen to be using prototype, so there is now a different problem to address.

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

ruby asin gem search failing on heroku

I've recently moved over from the ruby-aaws gem to asin gem, which is a lot simpler to use and understand. However, I've encountered a really strange issue that's causing search failures for specific queries and only on heroku.
My code is the following:
require 'asin'
client = ASIN::Client.instance
client.search(:Keywords => "Shark Tale", :SearchIndex => :UnboxVideo, :ResponseGroup => :ItemAttributes)
When this runs on my local box, it works perfect without issue. However, when I run this on heroku, I see the following error logs:
REXML::ParseException: #<NoMethodError: undefined method `[]' for nil:NilClass>
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:340:in `pull_event'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:183:in `pull'
/app/vendor/bundle/ruby/2.0.0/gems/crack-0.4.0/lib/crack/xml.rb:203:in `parse'
/app/vendor/bundle/ruby/2.0.0/gems/crack-0.4.0/lib/crack/xml.rb:235:in `parse'
/app/vendor/bundle/ruby/2.0.0/gems/asin-1.1.2/lib/asin/client.rb:375:in `call'
/app/vendor/bundle/ruby/2.0.0/gems/asin-1.1.2/lib/asin/client.rb:197:in `search'
(irb):223:in `irb_binding'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/workspace.rb:86:in `eval'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/workspace.rb:86:in `evaluate'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/context.rb:380:in `evaluate'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:492:in `block (2 levels) in eval_input'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:624:in `signal_status'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:489:in `block in eval_input'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:247:in `block (2 levels) in each_top_level_statement'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:233:in `loop'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:233:in `block in each_top_level_statement'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:232:in `catch'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb/ruby-lex.rb:232:in `each_top_level_statement'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:488:in `eval_input'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:397:in `block in start'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:396:in `catch'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/irb.rb:396:in `start'
/app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
/app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
/app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
...
Exception parsing
Line: 1
Position: 30315
Last 80 unconsumed characters:
Actor><Actor>Matthew Broderick</Actor><Actor>Patrick Warburton</Actor><Actor>J
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:439:in `rescue in pull_event'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:331:in `pull_event'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:183:in `pull'
from /app/vendor/bundle/ruby/2.0.0/gems/crack-0.4.0/lib/crack/xml.rb:203:in `parse'
from /app/vendor/bundle/ruby/2.0.0/gems/crack-0.4.0/lib/crack/xml.rb:235:in `parse'
from /app/vendor/bundle/ruby/2.0.0/gems/asin-1.1.2/lib/asin/client.rb:375:in `call'
from /app/vendor/bundle/ruby/2.0.0/gems/asin-1.1.2/lib/asin/client.rb:197:in `search'
from (irb):223
from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
This fails around 9 out of 10 times on Heroku. I tried a few variations and some of the following variations succeed all the time:
Change the query slightly
client.search(:Keywords => "Shark Tales", :SearchIndex => :UnboxVideo, :ResponseGroup => :ItemAttributes)
Change the ResponseGroup
client.search(:Keywords => "Shark Tale", :SearchIndex => :UnboxVideo, :ResponseGroup => :Offers)
Does anyone know what's causing this?
Realized that the discrepancy between my local box and heroku is with ruby version.
I'm using 1.9.3 on local box whereas my heroku setting is 2.0.0
This is a solution for 2.0.0 from the author of the asin gem
http://asin.herokuapp.com/

rails generate broken with NoMethodError

I am having some troubles with my Rails environment - running a command like:
$ rails generate scaffold_controller model_name
results in the following trace:
/Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/generated_attribute.rb:13:in `parse': undefined method `split' for :clear:Symbol (NoMethodError)
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/named_base.rb:161:in `block in parse_attributes!'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/named_base.rb:160:in `map'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/named_base.rb:160:in `parse_attributes!'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/named_base.rb:21:in `initialize'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators/resource_helpers.rb:18:in `initialize'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/thor-0.18.1/lib/thor/group.rb:227:in `new'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/thor-0.18.1/lib/thor/group.rb:227:in `dispatch'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/generators.rb:171:in `invoke'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/me/.rvm/gems/ruby-1.9.3-p392#myproject/gems/railties-3.2.13/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
As nothing in the trace seems to even be from my specific project, I'm a little stumped as to what could be going on. As you can see, I'm running rails 3.2.13 on an rvm-installed ruby 1.9.3.
Any ideas?
I had the same problem. it turns out that I had following line somewhere in my code.
include Term::ANSIColor
This code is needed for colorised Term output. But it is fine to comment it out temporarily when you need to generate or destroy scaffolds. The method or symbol 'clear' conflicts with other gems. So this probably fixes rake:erd as well.

Unable to run the rails generator for Draper

I'm on Ruby 1.9.3 and Rails 3.0.11. I recently installed Draper(0.12.0) gem, but I'm unable to run its generators. I get the following error when I try to run the generator on the Post model :-
rails generate decorator Post
/home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/whiny_nil.rb:48:in `method_missing': undefined method `config' for nil:NilClass (NoMethodError)
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/draper-0.12.0/lib/draper/railtie.rb:6:in `block in <class:Railtie>'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/railtie.rb:189:in `call'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/railtie.rb:189:in `each'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/railtie.rb:189:in `load_generators'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application.rb:147:in `block in load_generators'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application/railties.rb:11:in `each'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application/railties.rb:11:in `all'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/application.rb:147:in `load_generators'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:319:in `load_generators_from_railties!'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:278:in `lookup'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:141:in `find_by_namespace'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/generators.rb:161:in `invoke'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/commands/generate.rb:10:in `<top (required)>'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:593:in `new_constants_in'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /home/mohnish/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.11/lib/rails/commands.rb:17:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Any inputs, on how can I debug this would be really helpful.
Thank you.
The Problem is this section in v0.12.0 (the one you are using) https://github.com/drapergem/draper/blob/v0.12.0/lib/draper/railtie.rb#L5-L8
When I look at the master branch they changed to code to look like: https://github.com/drapergem/draper/blob/master/lib/draper/railtie.rb#L5-L10
You should upgrade your draper gem to the latest release and see if the error still occurs.

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.