Remote jobs failing on Heroku - ruby-on-rails

This is stemming from an email sent with resque scheduler on Heroku.
In an effort to islote my error :
NoMethodError: undefined method `name' for nil:NilClass
I deleted all the content of the email, and consolidated my mailer to look like just this :
def immediate_topic(enterprise_member, topic)
mail :to => 'email#land_of_emails.com',
:from => 'other_email#land_of_emails.com',
:date => DateTime.now,
:subject => "Subject"
end
Commited the code, deployed, and then same error! :
NoMethodError: undefined method `name' for nil:NilClass
I'm guessing that maybe resque or resque scheduler isn't actually restarting when I am deploying.
Anyone have any ideas on how I could possibly debug this ?
Full Backlog
app/mailers/notification_mailer.rb:20:in `immediate_topic'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8.rc2/lib/abstract_controller/base.rb:167:in `process_action'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8.rc2/lib/abstract_controller/base.rb:121:in `process'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8.rc2/lib/abstract_controller/rendering.rb:45:in `process'
vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.8.rc2/lib/action_mailer/base.rb:457:in `process'
vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.8.rc2/lib/action_mailer/base.rb:452:in `initialize'
vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.8.rc2/lib/action_mailer/base.rb:439:in `new'
vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.8.rc2/lib/action_mailer/base.rb:439:in `method_missing'
app/jobs/send_emails.rb:35:in `block (2 levels) in notify!'
app/jobs/send_emails.rb:34:in `each'
app/jobs/send_emails.rb:34:in `block in notify!'
app/jobs/send_emails.rb:33:in `each'
app/jobs/send_emails.rb:33:in `notify!'
app/jobs/send_emails.rb:11:in `block in perform'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8.rc2/lib/active_record/relation/delegation.rb:6:in `each'
vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.8.rc2/lib/active_record/relation/delegation.rb:6:in `each'
app/jobs/send_emails.rb:7:in `perform'
app/jobs/whisper_job.rb:29:in `perform'
app/jobs/whisper_job.rb:10:in `block in define_task'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
vendor/bundle/ruby/1.9.1/bin/rake:19:in `load'
vendor/bundle/ruby/1.9.1/bin/rake:19:in `<main>'

Related

rake aborted! undefined method `each' for nil:NilClass for capstone ptourist app

I'm getting this error every time I run 'heroku run rake ptourist:reset_all --remote staging' command.
Please let me know if more information is needed in order to adequately answer the question.
Full trace:
rake aborted!
NoMethodError: undefined method `each' for nil:NilClass
/app/vendor/bundle/ruby/2.2.0/gems/mongo-2.4.1/lib/mongo/cluster.rb:167:in `initialize'
/app/vendor/bundle/ruby/2.2.0/gems/mongo-2.4.1/lib/mongo/client.rb:370:in `new'
/app/vendor/bundle/ruby/2.2.0/gems/mongo-2.4.1/lib/mongo/client.rb:370:in `create_from_addresses'
/app/vendor/bundle/ruby/2.2.0/gems/mongo-2.4.1/lib/mongo/client.rb:235:in `initialize'
/app/vendor/bundle/ruby/2.2.0/gems/mongoid-5.2.0/lib/mongoid/clients/factory.rb:64:in `new'
/app/vendor/bundle/ruby/2.2.0/gems/mongoid-5.2.0/lib/mongoid/clients/factory.rb:64:in `create_client'
/app/vendor/bundle/ruby/2.2.0/gems/mongoid-5.2.0/lib/mongoid/clients/factory.rb:42:in `default'
/app/vendor/bundle/ruby/2.2.0/gems/mongoid-5.2.0/lib/mongoid/clients.rb:38:in `default'
/app/vendor/bundle/ruby/2.2.0/gems/database_cleaner-1.5.3/lib/database_cleaner/mongo2/truncation_mixin.rb:18:in `database'
/app/vendor/bundle/ruby/2.2.0/gems/database_cleaner-1.5.3/lib/database_cleaner/mongo2/truncation_mixin.rb:29:in `collections'
/app/vendor/bundle/ruby/2.2.0/gems/database_cleaner-1.5.3/lib/database_cleaner/mongo2/truncation_mixin.rb:9:in `clean'
/app/vendor/bundle/ruby/2.2.0/gems/database_cleaner-1.5.3/lib/database_cleaner/base.rb:46:in `clean_with'
/app/lib/tasks/ptourist.rake:101:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `call'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.2.6/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.2.6/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.2.6/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.2.6/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.2.0/bin/rake:23:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
Tasks: TOP => ptourist:reset_all => ptourist:users => ptourist:delete_all => ptourist:delete_subjects
This error occurs when foreign key values in your table contains empty data. The only way to solve this error is by deleting all the tables in which foreign key is present or make the entry in that table manually from console.
For example, employee table contains a column employee_type as a reference and that data is nil. Then we may get this error.

How to identify css file when asset precompilation error happens?

I have purchased a theme for my rails app, and unfortunately it has many css errors. When I try to precompile the assets this error gets popped up
Invalid CSS after " margin-top:": expected expression (e.g. 1px, bold), was "}"
(in /home/ubuntu/rails_app/app/assets/stylesheets/application.css)
(sass):6109
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:1146:in `expected'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/script/lexer.rb:199:in `expected!'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/script/parser.rb:471:in `assert_expr'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/script/parser.rb:49:in `parse'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:1022:in `sass_script'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:882:in `value!'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:859:in `declaration'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:582:in `block in declaration_or_ruleset'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:1122:in `call'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:1122:in `rethrow'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:592:in `declaration_or_ruleset'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:554:in `block_child'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:546:in `block_contents'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:535:in `block'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:529:in `ruleset'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:553:in `block_child'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:546:in `block_contents'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:82:in `stylesheet'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/scss/parser.rb:27:in `parse'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/engine.rb:342:in `_to_tree'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/engine.rb:315:in `_render'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.9/lib/sass/engine.rb:262:in `render'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sass-rails-3.2.6/lib/sass/rails/compressor.rb:16:in `compress'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.13/lib/sprockets/compressors.rb:74:in `compress'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/processing.rb:243:in `block in css_compressor='
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `call'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `evaluate'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:26:in `initialize'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:19:in `block in compile'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:18:in `compile'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:56:in `internal_precompile'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/bin/rake:23:in `load'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/home/ubuntu/.rvm/rubies/ruby-2.0.0-p0/bi...]
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `call'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `sh'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `sh'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/file_utils.rb:80:in `ruby'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `ruby'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0#global/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/bin/rake:23:in `load'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/bin/rake:23:in `<main>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompile
How am I supposed to find exactly which line of the css file the error has occurred since there margin-top is used over 500 times across the css files.
Thanks
I would do a ack-grep of the file and grab all the locations of margin-top.
What you are looking for is a margin-top declaration without an expression associated with it. It should be pretty clear that there is nothing in there but then again this could just be a very messy file and hard to read.
EDIT:
ack-grep margin-top: .
will just hunt through the directory for all the occurrences of margin-top:. If you want to use any other regex to look for a more specific thing you can do it with ack-grep.

Rails - Heroku push fails and results in uninitialized constant Log4r

For my application, I have recently set up Stripe and Oauth. It runs great locally, but when I try to push up to herokuapp (git push heroku master) it results in the following compiling error. How do I solve this?
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
uninitialized constant Log4r
/tmp/build_1s1esoyyqqqcw/config/environments/production.rb:87:in `block in <top (required)>'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:24:in `class_eval'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:24:in `configure'
/tmp/build_1s1esoyyqqqcw/config/environments/production.rb:1:in `<top (required)>'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:571:in `block in <class:Engine>'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:95:in `block (2 levels) in <top (required)>'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:205:in `block in invoke_prerequisites'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `each'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:203:in `invoke_prerequisites'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:183:in `block in invoke_with_call_chain'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/tmp/build_1s1esoyyqqqcw/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
Tasks: TOP => assets:precompile:primary => assets:environment
(See full trace by running task with --trace)
Precompiling assets failed, enabling runtime asset compilation
I'm not sure if the items below matter or impacts it.
production.rb
config.assets.precompile += %w( stripe_form.js )
Rails.logger = Logger.new(STDOUT)
Rails.logger = Log4r::Logger.new("Application Log")
I deleted the two lines in production.rb:
Rails.logger = Logger.new(STDOUT)
Rails.logger = Log4r::Logger.new("Application Log")
And now it pushes up to heroku succesfully.

How do you run rspec and cucumber on Heroku?

I'd like to be able to run rspec and cucumber on my staging app on Heroku. I have a separate production app and I push my development branch to staging and my master branch to production.
I have set the RACK_ENV variable to 'staging' and have also added a staging.rb config file.
Running rspec and cucumber locally:
Both rspec and cucumber run fine locally using the commands
$ rspec spec
..
$ cucumber features
Running rspec on Heroku staging app
The problem is that I can't get them to run on my Heroku staging app. I understand that the correct way to rspec on Heroku is:
$ heroku rake spec --remote staging
Whenever I run this though I get the following errors:
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.7/lib/active_record/railties/databases.rake:429:in `block (3 levels) in <top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `call'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.7/lib/active_record/railties/databases.rake:460:in `block (3 levels) in <top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `call'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1992:in `run'
/usr/ruby1.9.2/bin/rake:31:in `<main>'
(in /app)
Running cucumber on Heroku staging app
Similarly:
$ heroku rake cucumber --remote staging
Results in:
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.7/lib/active_record/railties/databases.rake:429:in `block (3 levels) in <top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `call'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.7/lib/active_record/railties/databases.rake:460:in `block (3 levels) in <top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `call'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:629:in `execute'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in `each'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1992:in `run'
/usr/ruby1.9.2/bin/rake:31:in `<main>'
(in /app)
The issue is clearly something to do with the database but I'm not sure how to address it.
The problem is that testing uses a separate database, not the one on which the application is running. This second database you don't get on Heroku. See Running Rails unit tests on Heroku for the answer to a similar question.

wrong number of arguments (1 for 0) has_many_association.rb:61

I am upgrading my app from Rails 2.2 to 2.3.5 and I am seeing the following error while using '<<' for saving a has_many relationship.
Eg: Breaks test
ev = UserEvent.new
# model specific code here
self.user_events << ev
Eg: Works
ev = UserEvent.new
# model specific code here
ev.user_id = self.id
ev.save!
This worked fine with Rails 2.2.
The issue that I see is similar to http://www.ruby-forum.com/topic/188598 (How can I track if a plugin or gem is causing this issue)
Full error log:
wrong number of arguments (1 for 0)
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:61:in `save'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:61:in `insert_record'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:145:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:145:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/autosave_association.rb:298:in `save_collection_association'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing_without_paginate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `each'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing_without_paginate'
/home/rails/.cruise/projects/rails235/work/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:167:in `method_missing'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/autosave_association.rb:289:in `save_collection_association'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/autosave_association.rb:168:in `autosave_associated_records_for_user_events'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:180:in `evaluate_method'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:180:in `evaluate_method'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:180:in `instance_eval'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:180:in `evaluate_method'
/home/rails/.cruise/projects/rails235/work/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:554:in `call'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/callbacks.rb:344:in `callback'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/callbacks.rb:267:in `create'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/base.rb:2874:in `create_or_update_without_callbacks'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/callbacks.rb:250:in `create_or_update'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/base.rb:2555:in `save_without_validation!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/validations.rb:1088:in `save_without_dirty!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/dirty.rb:87:in `save_without_transactions!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
./db/migrate//294_add_system_user.rb:43:in `up_without_benchmarks'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:282:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:282:in `migrate'
/opt/ruby-enterprise/lib/ruby/1.8/benchmark.rb:293:in `measure'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:282:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:365:in `__send__'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:365:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:486:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:562:in `call'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:562:in `ddl_transaction'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:485:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:472:in `each'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:472:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:400:in `up'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:383:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/railties/lib/tasks/databases.rake:116
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `call'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `each'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:583:in `invoke'
/home/rails/.cruise/projects/rails235/work/lib/tasks/cruisecontrol.rake:23
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `call'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `each'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:583:in `invoke'
/opt/cruisecontrolrb-1.3.0/tasks/cc_build.rake:5:in `invoke_rake_task'
/opt/cruisecontrolrb-1.3.0/tasks/cc_build.rake:35
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `call'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `each'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:583:in `invoke'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2047:in `invoke_task'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2025:in `top_level'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2025:in `each'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2025:in `top_level'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2064:in `standard_exception_handling'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2019:in `top_level'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:1997:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2064:in `standard_exception_handling'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:1994:in `run'
-e:1
Any help is tracking this down is really appreciated :)
I don't see anything wrong from your code, but in the error it looks like you're using a pagination plugin which may be your culprit.
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing_without_paginate'

Resources