Ruby on rails Rails应用程序在本地工作,但不在生产中

Ruby on rails Rails应用程序在本地工作,但不在生产中,ruby-on-rails,ruby,heroku,sqlite,Ruby On Rails,Ruby,Heroku,Sqlite,我有一个rails应用程序,在本地运行完全正常,但当我在heroku上推它时,它显示“应用程序错误” 我尝试访问heroku应用程序日志,但没有任何结果,但当我尝试运行heroko控制台时,它开始出现以下错误: C:\Sites\bbb>heroku run rails console This is the legacy Heroku CLI. Please install the new CLI from https://cli.herok u.com Running rails co

我有一个rails应用程序,在本地运行完全正常,但当我在heroku上推它时,它显示“应用程序错误”

我尝试访问heroku应用程序日志,但没有任何结果,但当我尝试运行heroko控制台时,它开始出现以下错误:

C:\Sites\bbb>heroku run rails console
This is the legacy Heroku CLI. Please install the new CLI from https://cli.herok
u.com
Running rails console on hidden-hollows-63773... up, run.4100 (Free)
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/connecti
on_adapters/connection_specification.rb:176:in `rescue in spec': Specified 'sqli
te3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to you
r Gemfile (and ensure its version is at the minimum required by ActiveRecord). (
Gem::LoadError)
        from /app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_re
cord/connection_adapters/connection_specification.rb:173:in `spec'
        from /app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_re
cord/connection_handling.rb:53:in `establish_connection'
        from /app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_re
cord/railtie.rb:125:in `block (2 levels) in <class:Railtie>'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/lazy_load_hooks.rb:43:in `instance_eval'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/lazy_load_hooks.rb:43:in `execute_hook'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/lazy_load_hooks.rb:50:in `block in run_load_hooks'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/lazy_load_hooks.rb:49:in `each'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/lazy_load_hooks.rb:49:in `run_load_hooks'
        from /app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_re
cord/base.rb:324:in `<module:ActiveRecord>'
        from /app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_re
cord/base.rb:24:in `<top (required)>'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:293:in `require'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:293:in `block in require'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:259:in `load_dependency'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:293:in `require'
        from /app/app/models/application_record.rb:1:in `<top (required)>'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:293:in `require'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:293:in `block in require'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:259:in `load_dependency'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:293:in `require'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:380:in `block in require_or_load'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:37:in `block in load_interlock'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies/interlock.rb:12:in `block in loading'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/concurrency/share_lock.rb:150:in `exclusive'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies/interlock.rb:11:in `loading'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:37:in `load_interlock'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:358:in `require_or_load'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:336:in `depend_on'
        from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active_s
upport/dependencies.rb:252:in `require_dependency'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine.
rb:476:in `block (2 levels) in eager_load!'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine.
rb:475:in `each'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine.
rb:475:in `block in eager_load!'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine.
rb:473:in `each'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine.
rb:473:in `eager_load!'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine.
rb:354:in `eager_load!'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/applica
tion/finisher.rb:59:in `each'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/applica
tion/finisher.rb:59:in `block in <module:Finisher>'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/initial
izable.rb:30:in `instance_exec'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/initial
izable.rb:30:in `run'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/initial
izable.rb:55:in `block in run_initializers'
        from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:228:in `block in tso
rt_each'
        from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:350:in `block (2 lev
els) in each_strongly_connected_component'
        from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:431:in `each_strongl
y_connected_component_from'
        from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:349:in `block in eac
h_strongly_connected_component'
        from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each'
        from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `call'
        from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each_strongl
y_connected_component'
        from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
        from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/initial
izable.rb:54:in `run_initializers'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/applica
tion.rb:352:in `initialize!'
        from /app/config/environment.rb:5:in `<top (required)>'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/applica
tion.rb:328:in `require'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/applica
tion.rb:328:in `require_environment!'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/command
s/commands_tasks.rb:157:in `require_application_and_environment!'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/command
s/commands_tasks.rb:77:in `console'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/command
s/commands_tasks.rb:49:in `run_command!'
        from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/command
s.rb:18:in `<top (required)>'
        from /app/bin/rails:4:in `require'
        from /app/bin/rails:4:in `<main>'
C:\Sites\bbb>heroku运行rails控制台
这是遗留的Heroku CLI。请从安装新的CLIhttps://cli.herok
u、 com
hidden-hollows-63773上的运行轨道控制台。。。启动,运行0.4100(免费)
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active\u record/connecti
在适配器/连接规范上。rb:176:in“rescue in spec”:指定为“sqli”
te3'用于数据库适配器,但未加载gem。向您添加'gem'sqlite3'`
GEMR文件(并确保其版本为ActiveRecord所要求的最低版本)。(
Gem::LoadError)
来自/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active\u re
跳线/连接适配器/连接规范。rb:173:在“规范”中
来自/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active\u re
跳线/连接处理。rb:53:in“建立连接”
来自/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active\u re
绳索/铁轨。rb:125:in‘块(2层)in’
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/延迟加载挂钩。rb:43:in'instance\u eval'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/延迟加载挂钩。rb:43:in'execute\u hook'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/延迟加载挂钩。rb:50:in“运行中的块加载挂钩”
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/延迟加载挂钩。rb:49:in'each'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/延迟加载挂钩。rb:49:“运行加载挂钩”
来自/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active\u re
跳线/底座。rb:324:in`'
来自/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active\u re
跳线/底座。rb:24:in`'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:293:in'require'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
Support/dependencies.rb:293:in'block in require'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:259:in'load_dependency'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:293:in'require'
from/app/app/models/application\u record.rb:1:in`'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:293:in'require'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
Support/dependencies.rb:293:in'block in require'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:259:in'load_dependency'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:293:in'require'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
support/dependencies.rb:380:in`block in require\u或\u load'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:37:在“加载中的块\u联锁”中
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
Support/dependencies/interlock.rb:12:在“加载中的块”中
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/并发/共享锁定.rb:150:在“独占”中
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
support/dependencies/interlock.rb:11:in'loading'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:37:in'load\u interlock'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:358:in'require_或_load'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖。rb:336:in'dependence_on'
来自/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.2/lib/active\s
支持/依赖项。rb:252:in'require_dependency'
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine。
rb:476:in“块(2层)中的快速加载!”
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine。
rb:475:在“每个”中
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine。
rb:475:in‘积木在急负荷中!’
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine。
rb:473:在“每个”中
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine。
rb:473:在“渴望加载”中
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/engine。
rb:354:在“急切的装载”中
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/applicata
收尾器/收尾器。rb:59:in‘each’
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/applicata
整流罩/整流罩。rb:59:in'block in'
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/initial
izable.rb:30:in'instance_exec'
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/initial
izable.rb:30:in'run'
来自/app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/initial
izable.rb:55:in`block in run_initializers'
from/app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:228:in`block in tso
各就各位
from/app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:350:in`block(2层
els)在每个强连接的组件中
from/app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:431:in`each_strongl
y_已连接_组件_自'
from/app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:349:in`block in`eac
胡强
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.2'
# Use sqlite3 as the database for Active Record

group :production do
    gem 'pg', '0.18.1'
    gem 'rails_12factor'
end

group :development, :test do
    gem 'sqlite3'
    gem 'byebug'
end

# 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'
# 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
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
#
default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: db/test.sqlite3

production:
  <<: *default
  database: db/production.sqlite3
production:
  database: example_production
  adapter: postgresql
  host: localhost
  password:
default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000
production:
  <<: *default
  database: db/production.sqlite3
production:
  adapter: postgresql
  pool: 5
  timeout: 5000
  database: app_name