ブラウザからURLを開こうとすると、application erroが出てしまします。
ターミナルでheroku run rails cを実行すると、
Running rails c on ⬢ myapp2525... up, run.9017 (Free) Traceback (most recent call last): 91: from /app/bin/rails:9:in `<main>' 90: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 89: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 88: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-oad_path_cache/core_ext/kernel_require.rb:23:in `require' 20: from /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/base.rb:27:in `<main>' 19: from /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/base.rb:327:in `<module:ActiveRecord>' 18: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.5/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks' 17: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.5/lib/active_support/lazy_load_hooks.rb:51:in `each' 16: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.5/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks' 15: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.5/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook' 14: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.5/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control' 13: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.5/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook' 12: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.5/lib/active_support/lazy_load_hooks.rb:71:in `class_eval' 11: from /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/railtie.rb:201:in `block (2 levels) in <class:Railtie>' 10: from /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/connection_handling.rb:51:in `establish_connection' 9: from /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:1052:in `establish_connection' 8: from /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/connection_adapters/connection_specification.rb:169:in `spec' 7: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require' 6: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 5: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 4: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 3: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 2: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 1: from /app/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/connection_adapters/sqlite3_adapter.rb:13:in `<main>' /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:346:in `block (2 levels) in replace_gem': Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it to your Gemfile. (LoadError)
gemgileのLoadErrorが出てしまいます。
gemfileの中身は
source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.6.5' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.0.3', '>= 6.0.3.3' # Use sqlite3 as the database for Active Record #gem 'sqlite3', '~> 1.4' # Use Puma as the app server gem 'puma', '~> 4.1' # Use SCSS for stylesheets gem 'sass-rails', '>= 6' # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker gem 'webpacker', '~> 4.0' # 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.7' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use Active Model has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use Active Storage variant # gem 'image_processing', '~> 1.2' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.4.2', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'sqlite3' end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '~> 3.2' # 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 :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of web drivers to run system tests with browsers gem 'webdrivers' end group :production do gem 'pg', '0.20.0' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem "haml-rails", ">= 1.0", '<= 2.0.1'
このようになっています。
# SQLite. Versions 3.8.0 and up are supported. # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' # default: &default adapter: sqlite3 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 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 adapter: postgresql database: db/production.pg
database.ymlはこのようにしています。
仮説
sql3が誤作動を起こしているように思われます。
どなたかご教授お願い致します。
heroku では sqlite ではなく postgresql を使うべきでは。
あなたの回答
tips
プレビュー