Search code examples
ruby-on-railspostgresqlherokuproduction

Load Error When Attempting to Push Rails app to Heroku


I have a Rails App I've been trying to push to Heroku. However, whenever I run git push heroku master, I am given back the following error:

 To https://git.heroku.com/top5application.git
  ! [remote rejected] master -> master (pre-receive hook declined

I've looked in the stack trace and it indicates:

 remote:        LoadError: cannot load such file -- List

As List is a model in the app, I checked that file and greyed out the require "List" command that was located in it, but that didn't make any difference.

I'd really appreciate any insight anyone has on this, because I've searched everywhere and can't find a workable solution.

Edit: The stack trace is:

remote: -----> Installing node-v6.11.1-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        LoadError: cannot load such file -- List
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `require'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `block in require'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:259:in `load_dependency'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `require'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/app/models/user.rb:3:in `<class:User>'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/app/models/user.rb:1:in `<top (required)>'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `require'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in `block in require'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/railties-5.0.6/lib/rails/application.rb:328:in `require_environment!'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/railties-5.0.6/lib/rails/application.rb:448:in `block in run_tasks_blocks'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
remote:        /tmp/build_095d59bef53353aa48e41eb90360323e/vendor/bundle/ruby/2.3.0/gems/rake-12.2.1/exe/rake:27:in `<top (required)>'
remote:        Tasks: TOP => environment
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to top5application.
remote: 
To https://git.heroku.com/top5application.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/top5application.git'

Solution

  • I figured it out. I was just committing the changes I made after removing require 'List' to heroku and not master. You have to first commit the changes to master and then push them to Heroku.