0

Sometime after pushing to Heroku, my app crashed.

Using Heroku's rollback feature, I found the most recent working commit.

But, when I reverted to it, the app still crashes.

The error is that the database doesn't specify an adapter-- but nothing was changed in the db config files...

remote:        Using rake 10.4.2
remote:        Using i18n 0.7.0
remote:        Using json 1.8.3
remote:        Using minitest 5.8.0
remote:        Using thread_safe 0.3.5
remote:        Using tzinfo 1.2.2
remote:        Using activesupport 4.2.4
remote:        Using builder 3.2.2
remote:        Using activemodel 4.2.4
remote:        Using arel 6.0.3
remote:        Using activerecord 4.2.4
remote:        Using bundler 1.9.7
remote:        Using dotenv 2.0.2
remote:        Using nenv 0.2.0
remote:        Using rspec-logsplit 0.1.3
remote:        Using hitimes 1.2.2
remote:        Using timers 4.1.1
remote:        Using celluloid-essentials 0.20.2.1
remote:        Using celluloid-extras 0.20.1
remote:        Using celluloid-fsm 0.20.1
remote:        Using celluloid-pool 0.20.1
remote:        Using celluloid-supervision 0.20.1.1
remote:        Using celluloid 0.17.1.2
remote:        Using connection_pool 2.2.0
remote:        Using ice_cube 0.11.1
remote:        Using jwt 1.5.1
remote:        Using kgio 2.9.3
remote:        Using multi_json 1.11.2
remote:        Using newrelic_rpm 3.13.0.299
remote:        Using numbers_in_words 0.2.0
remote:        Using pg 0.18.2
remote:        Using r18n-core 2.0.4
remote:        Using rack 1.6.4
remote:        Using rack-protection 1.5.3
remote:        Using raindrops 0.15.0
remote:        Using redis 3.2.1
remote:        Using redis-namespace 1.5.2
remote:        Using sidekiq 3.4.0
remote:        Using sidetiq 0.6.3
remote:        Using tilt 2.0.1
remote:        Using sinatra 1.4.6
remote:        Using sinatra-activerecord 2.0.8
remote:        Using sinatra-r18n 2.0.4
remote:        Using twilio-ruby 4.3.0
remote:        Using unicorn 4.9.0
remote:        Bundle complete! 20 Gemfile dependencies, 45 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (0.52s)
remote:        Cleaning up the bundler cache.
remote:        Could not detect rake tasks
remote:        ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
remote:        and using the production group of your Gemfile.
remote:        rake aborted!
remote:        ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:171:in `spec'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_handling.rb:50:in `establish_connection'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-activerecord-2.0.8/lib/sinatra/activerecord.rb:43:in `database='
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1216:in `set'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-activerecord-2.0.8/lib/sinatra/activerecord.rb:35:in `database_file='
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1216:in `set'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-activerecord-2.0.8/lib/sinatra/activerecord.rb:19:in `registered'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1399:in `block in register'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1397:in `each'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1397:in `register'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1977:in `register'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2038:in `register'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-activerecord-2.0.8/lib/sinatra/activerecord.rb:54:in `<module:Sinatra>'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/sinatra-activerecord-2.0.8/lib/sinatra/activerecord.rb:10:in `<top (required)>'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/app.rb:2:in `require
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/app.rb:2:in `<top (required)>'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/Rakefile:1:in `require'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/Rakefile:1:in `<top (required)>'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load_rakefile'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:689:in `raw_load_rakefile'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:94:in `block in load_rakefile'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:93:in `load_rakefile'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:77:in `block in run'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
remote:        /tmp/build_0638ee1c1d8c7aba8badade98388cd53/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
remote:        vendor/bundle/bin/rake:16:in `load'
remote:        vendor/bundle/bin/rake:16:in `<main>'
remote: 
remote: ###### WARNING:
remote:        You have not declared a Ruby version in your Gemfile.
remote:        To set your Ruby version add this line to your Gemfile:
remote:        ruby '2.0.0'
remote:        # See https://devcenter.heroku.com/articles/ruby-versions for more information.
remote: 
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:        Default types for Ruby  -> console, rake
remote: 
remote: -----> Compressing... done, 26.0MB
remote: -----> Launching... done, v372
remote:        https://joinstorytime.herokuapp.com/ deployed to Heroku
remote: 

Could this be due to a buggy gem update? Is there anyway to return to the gem versions of a previous release?

Phil
  • 307
  • 2
  • 17
  • To ask a simple question: Is there anyone else on your team who might not have done the Gem update? Does the app run for these people? – Tim Biegeleisen Sep 02 '15 at 01:21
  • I'm the only working on the project right now, so this won't work, sadly. I don't know what else it could be but a flawed gem, because I've reverted everything to the working commit (and before it), but still crash on deployment. – Phil Sep 02 '15 at 01:26
  • Read your stack trace. You have a database configuration problem. Also read this: http://stackoverflow.com/questions/23336755/activerecordadapternotspecified-database-configuration-does-not-specify-adapte – Tim Biegeleisen Sep 02 '15 at 01:38

2 Answers2

0

Since Heroku creates config/database.yml file, overwriting the one you might have in your project, it's a little difficult to troubleshoot.

My guess would be that a configuration variable (likely DATABASE_URL) was changed, and the new value had invalid characters or is malformed in some way. When you roll back the Heroku app, it also rolls back configuration variable changes. You can still see the variable changes in the app history though.

Robin Daugherty
  • 7,115
  • 4
  • 45
  • 59
0

Here's a link to a post with the answer:

Database configuration does not specify adapter (Sinatra + Heroku + Activerecord)

production: url: <%= ENV['DATABASE_URL'] %>

Community
  • 1
  • 1
Phil
  • 307
  • 2
  • 17