推送到heroku时,Ruby on Rails应用程序不断崩溃,日志中没有任何信息

时间:2019-06-15 07:16:09

标签: ruby-on-rails postgresql sqlite heroku

我试图将我的ruby on rails应用程序推送到heroku,但每次这样做,部署后该应用程序就会崩溃。日志也没有提到导致崩溃的原因。当我尝试运行heroku run rake db:migrate时,出现错误消息:

原因: Gem :: LoadError:sqlite3不属于捆绑包。将其添加到您的Gemfile中。

我在这里看到了很多帖子,做了很多建议,将sqlite3 gem移到gemfile的开发方法中,然后将pg gem放入gemfile的生产方法中。然后,我运行捆绑安装程序并尝试再次推送到heroku,但仍然遇到应用程序崩溃的同一问题,并且我在日志中没有得到任何相关的反馈。

这是我的gem文件:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.7', '>= 5.0.7.2'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
gem 'devise'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platform: :mri
  gem 'sqlite3'

  #All from :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '~> 3.0.5'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

#group :development do
#end

group :production do
  gem 'pg', '~> 0.21' # for Heroku deployment
  gem 'rails_12factor'
end

group :test do
  gem 'shoulda-matchers'
  gem 'cucumber-rails', require: false
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

这是我尝试运行heroku run rake db:migrate时遇到的错误:

rake aborted!
Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/connection_specification.rb:176:in `rescue in spec'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/connection_specification.rb:173:in `spec'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:53:in `establish_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/railtie.rb:125:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:49:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/base.rb:324:in `<module:ActiveRecord>'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/base.rb:24:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/app/models/application_record.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:380:in `block in require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/concurrency/share_lock.rb:150:in `exclusive'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies/interlock.rb:11:in `loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:37:in `load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:358:in `require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:512:in `load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:203:in `const_missing'
/app/app/models/user.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:380:in `block in require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/concurrency/share_lock.rb:150:in `exclusive'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies/interlock.rb:11:in `loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:37:in `load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:358:in `require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:512:in `load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:203:in `const_missing'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:268:in `const_get'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:268:in `block in constantize'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:266:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:266:in `inject'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:266:in `constantize'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:584:in `get'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:615:in `constantize'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise.rb:320:in `get'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:83:in `to'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:78:in `modules'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:95:in `routes'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:162:in `default_used_route'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:72:in `initialize'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise.rb:350:in `new'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise.rb:350:in `add_mapping'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/rails/routes.rb:243:in `block in devise_for'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/rails/routes.rb:242:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/rails/routes.rb:242:in `devise_for'
/app/config/routes.rb:3:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/routing/route_set.rb:391:in `instance_exec'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/routing/route_set.rb:391:in `eval_block'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/routing/route_set.rb:373:in `draw'
/app/config/routes.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `block in load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:40:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/file_update_checker.rb:77:in `execute'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:27:in `updater'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/finisher.rb:119:in `block in <module:Finisher>'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/initializable.rb:54:in `run_initializers'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application.rb:352:in `initialize!'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application.rb:328:in `require_environment!'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application.rb:448:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'

Caused by:
Gem::LoadError: sqlite3 is not part of the bundle. Add it to your Gemfile.
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/rubygems_integration.rb:377:in `block (2 levels) in replace_gem'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:7:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:53:in `establish_connection'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/railtie.rb:125:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:49:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/base.rb:324:in `<module:ActiveRecord>'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/base.rb:24:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/app/models/application_record.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:380:in `block in require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/concurrency/share_lock.rb:150:in `exclusive'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies/interlock.rb:11:in `loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:37:in `load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:358:in `require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:512:in `load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:203:in `const_missing'
/app/app/models/user.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:380:in `block in require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/concurrency/share_lock.rb:150:in `exclusive'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies/interlock.rb:11:in `loading'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:37:in `load_interlock'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:358:in `require_or_load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:512:in `load_missing_constant'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:203:in `const_missing'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:268:in `const_get'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:268:in `block in constantize'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:266:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:266:in `inject'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/inflector/methods.rb:266:in `constantize'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:584:in `get'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:615:in `constantize'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise.rb:320:in `get'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:83:in `to'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:78:in `modules'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:95:in `routes'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:162:in `default_used_route'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/mapping.rb:72:in `initialize'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise.rb:350:in `new'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise.rb:350:in `add_mapping'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/rails/routes.rb:243:in `block in devise_for'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/rails/routes.rb:242:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/devise-4.6.2/lib/devise/rails/routes.rb:242:in `devise_for'
/app/config/routes.rb:3:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/routing/route_set.rb:391:in `instance_exec'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/routing/route_set.rb:391:in `eval_block'
/app/vendor/bundle/ruby/2.5.0/gems/actionpack-5.0.7.2/lib/action_dispatch/routing/route_set.rb:373:in `draw'
/app/config/routes.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `block in load'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:287:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:40:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/file_update_checker.rb:77:in `execute'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:27:in `updater'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application/finisher.rb:119:in `block in <module:Finisher>'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/initializable.rb:54:in `run_initializers'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application.rb:352:in `initialize!'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application.rb:328:in `require_environment!'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.0.7.2/lib/rails/application.rb:448:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

我不确定问题的确切原因,因为我知道heroku不支持sqlite,仅支持postgres,但这使我可以很好地部署应用程序。只是不允许我将数据库迁移到heroku。有谁知道为什么要这么做?

1 个答案:

答案 0 :(得分:0)

删除不再需要的rails_12factor宝石。为了维持dev / prod parity,将pg gem移出生产组,并尝试在本地成功运行该应用程序并重新部署。可以通过这种方式找到导致您的应用使用sqlite的原因,并针对Heroku Deploy进行修复。