Migration error on heroku deploy - ruby-on-rails

NoMethodError: undefined method `dump_schema_after_migration=' for ActiveRecord:
:Base:Class
on
$ heroku run rake db:migrate
I am new to heroku deployment and not able to solve it, please help in solving it
Thanks in advance.
this is what I am actually getting.
$ heroku run rake db:migrate
This is the complete error trace:
Running `rake db:migrate` attached to terminal... up, run.4727
rake aborted!
NoMethodError: undefined method `dump_schema_after_migration=' for ActiveRecord:
:Base:Class
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/dynamic_
matchers.rb:22:in `method_missing'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/railtie.
rb:166:in `block (3 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/railtie.
rb:165:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/railtie.
rb:165:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l
oad_hooks.rb:38:in `instance_eval'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l
oad_hooks.rb:38:in `execute_hook'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l
oad_hooks.rb:28:in `block in on_load'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l
oad_hooks.rb:27:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/lazy_l
oad_hooks.rb:27:in `on_load'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/railtie.
rb:114:in `block in <class:Railtie>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:30:
in `instance_exec'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:30:
in `run'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:55:
in `block in run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:54:
in `run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/application.rb:215:i
n `initialize!'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/depend
encies.rb:229:in `require'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/depend
encies.rb:229:in `block in require'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/depend
encies.rb:214:in `load_dependency'
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/depend
encies.rb:229:in `require'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/application.rb:189:i
n `require_environment!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.8/lib/rails/application.rb:250:i
n `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

Assuming you are using Rais 4, just remove below code in your config/environments/production.rb
config.active_record.dump_schema_after_migration = false

Related

Best In Place: wrong number of arguments (given 0, expected 3) (ArgumentError) with Action_view ' Initialize '

I recently upgraded Rails app 4.1 to 6.1 and I got this error shown below:
rake aborted!
ArgumentError: wrong number of arguments (given 0, expected 3)
/usr/local/bundle/gems/actionview-6.1.4.1/lib/action_view/base.rb:230:in `initialize'
/usr/local/bundle/gems/best_in_place-3.1.1/lib/best_in_place/railtie.rb:7:in `new'
/usr/local/bundle/gems/best_in_place-3.1.1/lib/best_in_place/railtie.rb:7:in `block in
<class:Railtie>'
/usr/local/bundle/gems/activesupport-6.1.4.1/lib/active_support/lazy_load_hooks.rb:68:in
`block in execute_hook'
/usr/local/bundle/gems/activesupport-6.1.4.1/lib/active_support/lazy_load_hooks.rb:61:in
`with_execution_control'
/usr/local/bundle/gems/activesupport-6.1.4.1/lib/active_support/lazy_load_hooks.rb:66:in
`execute_hook'
/usr/local/bundle/gems/activesupport-6.1.4.1/lib/active_support/lazy_load_hooks.rb:52:in
`block in run_load_hooks'
/usr/local/bundle/gems/activesupport-6.1.4.1/lib/active_support/lazy_load_hooks.rb:51:in
`each'
/usr/local/bundle/gems/activesupport-6.1.4.1/lib/active_support/lazy_load_hooks.rb:51:in
`run_load_hooks'
/usr/local/bundle/gems/railties-6.1.4.1/lib/rails/application/finisher.rb:140:in `block
in <module:Finisher>'
/usr/local/bundle/gems/railties-6.1.4.1/lib/rails/initializable.rb:32:in `instance_exec'
/usr/local/bundle/gems/railties-6.1.4.1/lib/rails/initializable.rb:32:in `run'
/usr/local/bundle/gems/railties-6.1.4.1/lib/rails/initializable.rb:61:in `block in
run_initializers'
/usr/local/bundle/gems/railties-6.1.4.1/lib/rails/initializable.rb:60:in
`run_initializers'
/usr/local/bundle/gems/railties-6.1.4.1/lib/rails/application.rb:391:in `initialize!'
/usr/src/app/config/environment.rb:4:in `<top (required)>'
/usr/local/bundle/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/bundle/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/bundle/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in
`block in require'
/usr/local/bundle/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:299:in
`load_dependency'
/usr/local/bundle/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in
`require'
/usr/local/bundle/gems/railties-6.1.4.1/lib/rails/application.rb:367:in
`require_environment!'
/usr/local/bundle/gems/railties-6.1.4.1/lib/rails/application.rb:533:in `block in
run_tasks_blocks'
/usr/local/bundle/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
Tasks: TOP => resque:work => resque:preload => resque:setup => environment
(See full trace by running task with --trace)
when I comment the gem best_in_place error goes out but this gem is used in the app that why it gives an error at localhost 3000 that why I comment out, again and again, same error occurs if any one have solution so give answers otherwise answer mail to santu.essence#gmail.com
From best_in_placce github page:
NB: For Rails >= 6.1 you can install the gem from this repository with:
gem "best_in_place", git: "https://github.com/mmotherwell/best_in_place"

heroku push error: "rake assets:precompile rake aborted!"

I'm trying to push my changes to Heroku with the following command: git push heroku master
When running the rake assets:precompile, I get the following error(s):
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
NameError: undefined local variable or method `fkalkhalidi' for #<Pinteresting::Application:0x007f48fd2d6fc0>
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/config/environments/production.rb:80:in `block in <top (required)>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/railtie.rb:210:in `instance_eval'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/railtie.rb:210:in `configure'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/config/environments/production.rb:1:in `<top (required)>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `block in require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:232:in `load_dependency'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/engine.rb:594:in `block (2 levels) in <class:Engine>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/engine.rb:593:in `each'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/engine.rb:593:in `block in <class:Engine>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:30:in `run'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:44:in `each'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:44:in `tsort_each_child'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/application.rb:300:in `initialize!'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/config/environment.rb:5:in `<top (required)>'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `block in require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:232:in `load_dependency'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/application.rb:276:in `require_environment!'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/application.rb:389:in `block in run_tasks_blocks'
/tmp/build_deb19ff2fabe605365740a1f29b87f8b/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-2.2.0/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
Appreciate any help. First time learning RoR.
What's inside the file config/environments/production.rb at line 80?
Search your code, specifically in the production.rb file. It's likely there is a fkalkhalidi string somewhere that is causing the error.

Can't push changes to heroku

I've added Twilio to my rails app and when I go to push the changes to heroku I'm getting the following error. I've having trouble tracing it back to the issue.
Running: rake assets:precompile
rake aborted!
undefined method `strip' for nil:NilClass
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/twilio-ruby-3.11.5/lib/twilio-ruby/rest/client.rb:142:in `initialize'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/config/initializers/twilio.rb:6:in `new'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/config/initializers/twilio.rb:6:in `<top (required)>'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `each'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `block in <class:Engine>'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `each'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `tsort_each_child'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/config/environment.rb:5:in `<top (required)>'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:250:in `block in run_tasks_blocks'
/tmp/build_04f806c2-b1ba-46f8-a554-26485f452fbd/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
Update: In my Twilio.rb (config/initializer) I had copied over some code from Twilio's site.
require "twilio-ruby"
Once I removed this I was able to get it to push to heroku.

Cannot load Rails app fetched from GitHub; rake, rails server not working

I cloned an app folder from a GitHub repository, and after bundle install the gems, I tried to use the rake db:reset and rake db:migrate commands, neither worked, and here is my error message:
>[app_folder]rake db:reset
rake aborted!
Could not load database configuration. No such file - /Users/harry/Dropbox/apps/app_folder/config/database.yml
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/application/configuration.rb:110:in `database_configuration'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:174:in `block (2 levels) in <class:Railtie>'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:173:in `block in <class:Railtie>'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/harry/Dropbox/apps/app_folder/config/environment.rb:5:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:reset => environment
(See full trace by running task with --trace)
[app_folder]
I get similar errors when I try to run rails server or rails console. Would really appreciate any help!! Thanks a lot!
Usually rails apps have config/database.yml.example, copy this file to config/database.yml and overwrite database connection settings if necessary.

Heroku Precompiled Assets Failed

I am having difficulties troubleshooting the following and figuring out why my assets are failing to precompile at slug compilation... the odd thing is, is that the assets compile fine at runtime when I check the live logs... any ideas? Is it trying to connect to the database?
Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
undefined method `match' for nil:NilClass
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/mongo_uri.rb:49:in `initialize'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/factory.rb:104:in `new'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/factory.rb:104:in `parse'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/factory.rb:62:in `create_session'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions/factory.rb:43:in `default'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/sessions.rb:109:in `default'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid.rb:129:in `default_session'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.4/lib/mongoid/railtie.rb:131:in `block (2 levels) in <class:Railtie>'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:34:in `call'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `each'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application/finisher.rb:59:in `block in <module:Finisher>'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/config/environment.rb:5:in `<top (required)>'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/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_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
/tmp/build_27348f41-abb7-46f0-a7ac-6f66bf0feff7/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
Check whether your asset precompile requires access to ENV variables during when its run. Its hard to tell from your stack trace, but this might be a good resource to check out: https://devcenter.heroku.com/articles/rails-asset-pipeline
Essentially, you can enable the user-env-compile labs feature on heroku to give your app instance access to ENV vars during your precompile.
heroku labs:enable user-env-compile -a myapp
more information about that here: https://devcenter.heroku.com/articles/labs-user-env-compile
I had just added Unicorn, I added the following to my application.rb in config and was able to precompile:
config.assets.initialize_on_precompile = false

Resources