0

Screenshot of error message on Heroku dashboard.

Here's the log (I'm very new to this so I've redacted some stuff in the lower section that looked like it might be private):

-----> Using set buildpack heroku/ruby
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.1.5
###### WARNING:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.
       In rare occasions Bundler may not be able to resolve your dependencies at all.
       https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 1.9.7
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
       Your Gemfile lists the gem rest-client (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the version of just one of them later.
       Fetching gem metadata from http://rubygems.org/...........
       Fetching version metadata from http://rubygems.org/...
       Fetching dependency metadata from http://rubygems.org/..
       Resolving dependencies.....
       Using rake 10.5.0
       Using i18n 0.7.0
       Using json 1.8.3
       Using minitest 5.8.4
       Using thread_safe 0.3.5
       Using builder 3.2.2
       Using erubis 2.7.0
       Using mini_portile2 2.0.0
       Using rack 1.6.4
       Using mime-types 2.99
       Using arel 6.0.3
       Using acts_as_follower 0.2.1
       Using acts_as_votable 0.10.0
       Using httpclient 2.7.1
       Using aws_cf_signer 0.1.3
       Using unf_ext 0.0.7.2
       Using netrc 0.11.0
       Using bundler 1.9.7
       Using thor 0.19.1
       Using concurrent-ruby 1.0.0
       Using bcrypt 3.1.10
       Using coffee-script-source 1.10.0
       Using execjs 2.6.0
       Using orm_adapter 0.5.0
       Using elo 0.1.0
       Using exception_handler 0.4.7
       Using geocoder 1.3.0
       Using gmaps4rails 2.1.2
       Using gravtastic 3.2.6
       Using tilt 2.0.2
       Using hashie 3.4.3
       Using high_voltage 2.2.1
       Using imgkit 1.6.1
       Using multi_json 1.11.2
       Using kgio 2.10.0
       Using libv8 3.16.14.13
       Using newrelic_rpm 3.14.3.313
       Using pg 0.18.4
       Using pusher-signature 0.1.8
       Using rack-cors 0.4.0
       Using rails_serve_static_assets 0.0.5
       Using rails_stdout_logging 0.0.4
       Using raindrops 0.15.0
       Using rdiscount 2.1.8
       Using redcarpet 3.3.4
       Using ref 2.0.0
       Using sass 3.4.21
       Using rack-test 0.6.3
       Using warden 1.2.6
       Using mail 2.6.3
       Using nokogiri 1.6.7.2
       Using algoliasearch 1.7.0
       Using unf 0.1.4
       Using tzinfo 1.2.2
       Using coffee-script 2.4.1
       Using uglifier 2.7.2
       Using haml 4.0.7
       Using omniauth 1.3.1
       Using sprockets 3.5.2
       Using rollbar 1.4.5
       Using pusher 0.16.0
       Using rails_12factor 0.0.3
       Using unicorn 5.0.1
       Using therubyracer 0.12.2
       Using loofah 2.0.3
       Using impressionist 1.5.1
       Using algoliasearch-rails 1.14.1
       Using domain_name 0.5.20160128
       Using activesupport 4.2.1
       Using rails-html-sanitizer 1.0.3
       Using http-cookie 1.0.2
       Using rails-deprecated_sanitizer 1.0.3
       Using globalid 0.3.6
       Using activemodel 4.2.1
       Using carmen 1.0.2
       Using jbuilder 2.4.1
       Using rest-client 1.8.0
       Using activejob 4.2.1
       Using activerecord 4.2.1
       Using rails-dom-testing 1.0.7
       Using cloudinary 1.1.2
       Using friendly_id 5.1.0
       Using actionview 4.2.1
       Using actionpack 4.2.1
       Using actionmailer 4.2.1
       Using railties 4.2.1
       Using sprockets-rails 3.0.1
       Using simple_form 3.2.1
       Using rails 4.2.1
       Using momentjs-rails 2.11.0
       Using coffee-rails 4.1.1
       Using jquery-rails 4.1.0
       Using responders 2.1.1
       Using public_activity 1.4.2
       Using sass-rails 5.0.4
       Using attachinary 1.3.1
       Using carmen-rails 1.0.1
       Using rails_autolink 1.1.6
       Using bootstrap3-datetimepicker-rails 4.7.14
       Using turbolinks 2.5.3
       Using commontator 4.10.5
       Using devise 3.5.6
       Using devise_token_auth 0.1.37
       Installing dalli 2.7.6
       Bundle complete! 53 Gemfile dependencies, 104 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into ./vendor/bundle.
       Bundle completed (6.84s)
       Cleaning up the bundler cache.
       Your Gemfile lists the gem rest-client (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the version of just one of them later.
       Removing dalli (2.7.5)
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       NoMethodError: undefined method `setup' for ExceptionHandler:Module

   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/config/initializers/exception_handler.rb:6:in `<top (required)>'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/config/environment.rb:5:in `<top (required)>'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:328:in `require_environment!'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.0.1/lib/sprockets/rails/task.rb:62: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

Thanks for all the help

EDIT:

Here is the new build log:

-----> Using set buildpack heroku/ruby
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.1.5
###### WARNING:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.
       In rare occasions Bundler may not be able to resolve your dependencies at all.
       https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 1.9.7
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
       Your Gemfile lists the gem rest-client (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the version of just one of them later.
       Fetching gem metadata from http://rubygems.org/...........
       Fetching version metadata from http://rubygems.org/...
       Fetching dependency metadata from http://rubygems.org/..
       Resolving dependencies.....
       Using rake 10.5.0
       Using i18n 0.7.0
       Using json 1.8.3
       Using minitest 5.8.4
       Using thread_safe 0.3.5
       Using builder 3.2.2
       Using erubis 2.7.0
       Using mini_portile2 2.0.0
       Using rack 1.6.4
       Using arel 6.0.3
       Using acts_as_follower 0.2.1
       Using acts_as_votable 0.10.0
       Using httpclient 2.7.1
       Using aws_cf_signer 0.1.3
       Using unf_ext 0.0.7.2
       Using netrc 0.11.0
       Using bundler 1.9.7
       Using thor 0.19.1
       Using concurrent-ruby 1.0.0
       Using bcrypt 3.1.10
       Using coffee-script-source 1.10.0
       Using execjs 2.6.0
       Using orm_adapter 0.5.0
       Using elo 0.1.0
       Using exception_handler 0.4.7
       Installing mime-types 2.99.1
       Using gmaps4rails 2.1.2
       Using gravtastic 3.2.6
       Using tilt 2.0.2
       Using hashie 3.4.3
       Using high_voltage 2.2.1
       Using imgkit 1.6.1
       Using multi_json 1.11.2
       Using kgio 2.10.0
       Using libv8 3.16.14.13
       Installing dalli 2.7.6
       Using pg 0.18.4
       Using pusher-signature 0.1.8
       Using rack-cors 0.4.0
       Using rails_serve_static_assets 0.0.5
       Using rails_stdout_logging 0.0.4
       Using raindrops 0.15.0
       Using rdiscount 2.1.8
       Using redcarpet 3.3.4
       Using ref 2.0.0
       Using sass 3.4.21
       Using tzinfo 1.2.2
       Using nokogiri 1.6.7.2
       Using rack-test 0.6.3
       Using warden 1.2.6
       Using algoliasearch 1.7.0
       Using unf 0.1.4
       Using sprockets 3.5.2
       Using coffee-script 2.4.1
       Using uglifier 2.7.2
       Using mail 2.6.3
       Using haml 4.0.7
       Using omniauth 1.3.1
       Using rollbar 1.4.5
       Installing geocoder 1.3.1
       Using rails_12factor 0.0.3
       Using unicorn 5.0.1
       Using therubyracer 0.12.2
       Using activesupport 4.2.1
       Using loofah 2.0.3
       Using impressionist 1.5.1
       Using algoliasearch-rails 1.14.1
       Installing domain_name 0.5.20160216
       Using rails-deprecated_sanitizer 1.0.3
       Using globalid 0.3.6
       Using activemodel 4.2.1
       Using carmen 1.0.2
       Using jbuilder 2.4.1
       Using rails-html-sanitizer 1.0.3
       Using http-cookie 1.0.2
       Using rails-dom-testing 1.0.7
       Using activejob 4.2.1
       Using activerecord 4.2.1
       Using rest-client 1.8.0
       Using actionview 4.2.1
       Using friendly_id 5.1.0
       Using cloudinary 1.1.2
       Using actionpack 4.2.1
       Using actionmailer 4.2.1
       Using railties 4.2.1
       Installing pusher 0.17.0
       Using simple_form 3.2.1
       Using momentjs-rails 2.11.0
       Using coffee-rails 4.1.1
       Using jquery-rails 4.1.0
       Using responders 2.1.1
       Installing sprockets-rails 3.0.2
       Using bootstrap3-datetimepicker-rails 4.7.14
       Using turbolinks 2.5.3
       Using devise 3.5.6
       Using rails 4.2.1
       Using sass-rails 5.0.4
       Using attachinary 1.3.1
       Using carmen-rails 1.0.1
       Using commontator 4.10.5
       Using devise_token_auth 0.1.37
       Using rails_autolink 1.1.6
       Installing public_activity 1.4.3
       Installing newrelic_rpm 3.15.0.314
       Bundle complete! 53 Gemfile dependencies, 104 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into ./vendor/bundle.
       Bundle completed (7.39s)
       Cleaning up the bundler cache.
       Your Gemfile lists the gem rest-client (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the version of just one of them later.
       Removing public_activity (1.4.2)
       Removing domain_name (0.5.20160128)
       Removing pusher (0.16.0)
       Removing mime-types (2.99)
       Removing dalli (2.7.5)
       Removing newrelic_rpm (3.14.3.313)
       Removing sprockets-rails (3.0.1)
       Removing geocoder (1.3.0)
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       NoMethodError: undefined method `setup' for ExceptionHandler:Module
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/config/initializers/exception_handler.rb:6:in `<top (required)>'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/config/environment.rb:5:in `<top (required)>'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:328:in `require_environment!'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.0.2/lib/sprockets/rails/task.rb:62: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
Jean
  • 13
  • 5

2 Answers2

1

From the Heroku docs:

This means that your app is attempting to connect to the database as part of rake assets:precompile. Because the config vars are not present in the environment, we use a placeholder DATABASE_URL to satisfy Rails.

To resolve this issue, ensure that the following line appears in your config/application.rb:

# config/application.rb
config.assets.initialize_on_precompile = false

Once added, commit your change and redeploy to Heroku – your assets should compile without your app attempting to connect to the database, which should resolve the error you're witnessing.

UPDATE:

Line 46 of your stacktrace includes the following message: Devise.secret_key was not set.

According to the author of Devise, José Valim, this issue can be resolved in the following manner:

Please add the following to your Devise initializer:

config.secret_key = '-- secret key --'

Alternatively, the following solution seems to have worked for a number of users:

I went to my routes.rb file and commented out the line devise_for :installs

Then I went back and reran rails generate devise:install. If that doesn't work, use the previous version of devise by editing your Gemfile's reference to Devise like this: gem 'devise', '3.0.3' and then follow the steps i mentioned above.

Please look at https://stackoverflow.com/a/19650687/1380867 and thanks zeantsoi for this answer

Community
  • 1
  • 1
MZaragoza
  • 10,108
  • 9
  • 71
  • 116
1

I made ExceptionHandler and it seems it's causing the issue...

NoMethodError: undefined method `setup' for ExceptionHandler:Module


In ExceptionHandler > 0.4.5, the initializer has been replaced with config methods:

enter image description here

From the docs:

IMPORTANT

If you're upgrading to 0.4.6, you need to remove your exception_handler initializer.

We've changed the load process to use Rails app config - you don't need the exception_handler initializer any more


You need to copy your exception_handler settings from config/initializers/exception_handler.rb and place them into config/production.rb.

You need to delete config/initializers/exception_handler.rb

--

I am available to chat if you leave a comment etc

Richard Peck
  • 76,116
  • 9
  • 93
  • 147
  • Hi, thank you for your answer and I apologize for the delay in my response. I have copied those settings and deleted the file, but my commits are still not deploying. – Jean Feb 24 '16 at 03:33
  • 1
    The heroku dashboard shows the same error ("Build failed") and I've added the new build log to my original post. Thanks. – Jean Feb 24 '16 at 09:00
  • Thanks!! Still says you have the initializer? Are you sure you committed the new version of the code before pushing? – Richard Peck Feb 24 '16 at 09:34
  • Are you sure you removed `config/initializers/exception_handler.rb` and then committed the code again? – Richard Peck Feb 24 '16 at 09:36
  • 1
    Thanks Richard, I helped out Jean with this one. It is great that you maintain your library so well! – Thomas Davis Feb 24 '16 at 10:17
  • Thanks Thomas - how did you fix it in the end? – Richard Peck Feb 24 '16 at 11:04