推送到Heroku后的某个时候,我的应用程序崩溃了。
使用Heroku的回滚功能,我找到了最近的工作提交。
但是,当我恢复它时,应用程序仍然崩溃。
错误是数据库没有指定适配器 - 但在db配置文件中没有更改...
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:
这可能是由于有缺陷的宝石更新造成的吗?反正有没有回到之前版本的gem版本?
答案 0 :(得分:0)
由于Heroku创建了config/database.yml
文件,覆盖了项目中可能存在的文件,因此排除故障有点困难。
我的猜测是配置变量(可能DATABASE_URL
)已更改,新值包含无效字符或以某种方式格式错误。当您回滚Heroku应用程序时,它还会回滚配置变量更改。您仍然可以在应用历史记录中看到变量更改。
答案 1 :(得分:0)
以下是指向答案的帖子的链接:
Database configuration does not specify adapter (Sinatra + Heroku + Activerecord)
production:
url: <%= ENV['DATABASE_URL'] %>