前提・実現したいこと
herokuにデプロイ後エラーが起き、ローカルサーバーを立ち上げられなくなりました。
ちなみに以下のサイトを参考にデプロイしました
https://qiita.com/kazukimatsumoto/items/a0daa7281a3948701c39
発生している問題・エラーメッセージ
ActiveRecord::ConnectionNotEstablished No connection pool with 'primary' found. def retrieve_connection(spec_name) #:nodoc: pool = retrieve_connection_pool(spec_name) raise ConnectionNotEstablished, "No connection pool with '#{spec_name}' found." unless pool pool.connection end
https://i.gyazo.com/39b65746a9b30e7d3592816da4eef21e.png
該当のソースコード
Gemfile
1group :development, :test do 2 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 3 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 4 gem 'sqlite3' 5end 6 7group :development do 8 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 9 gem 'web-console', '>= 3.3.0' 10 gem 'listen', '>= 3.0.5', '< 3.2' 11 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 12 gem 'spring' 13 gem 'spring-watcher-listen', '~> 2.0.0' 14end 15 16group :test do 17 # Adds support for Capybara system testing and selenium driver 18 gem 'capybara', '>= 2.15' 19 gem 'selenium-webdriver' 20 # Easy installation and use of chromedriver to run system tests with Chrome 21 gem 'chromedriver-helper' 22end 23 24# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 25gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 26 27group :production do 28 gem 'pg' 29end 30 31gem 'kaminari', '~> 0.17.0'
databaseyml
1 2default: &default 3 adapter: mysql2 4 encoding: utf8 5 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 6 username: root 7 password: 8 socket: /tmp/mysql.sock 9 10development: 11 <<: *default 12 database: Healthcare_development 13 14test: 15 <<: *default 16 database: Healthcare_test 17 18production: 19 <<: *default 20 database: Healthcare_production 21 username: Healthcare 22 password: <%= ENV['HEALTHCARE_DATABASE_PASSWORD'] %> 23 24 production: 25 <<: *default 26 adapter: postgresql 27 encoding: unicode 28 pool: 5 29 30development: 31 adapter: postgresql 32 host: localhost 33 username: user 34 database: app-dev
試したこと
https://qiita.com/masayuki14/items/27ca4764d0bcae4affea
https://teratail.com/questions/174307
これらのサイトを見ながら解決を試みた
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。