前提・実現したいこと
Railsチュートリアルに沿って勉強しており、今Cloud9上でサーバーを立ち上げようとしています。
下記のエラーメッセージが表示され、いくつかの手段を実行したもののエラーを解消できずにいるので
ご教示いただきたいです。
発生している問題・エラーメッセージ
ActiveRecord::ConnectionNotEstablished No connection pool with 'primary' found.
該当のソースコード
activerecord (6.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:1107:in `retrieve_connection' activerecord (6.0.0) lib/active_record/connection_handling.rb:231:in `retrieve_connection' activerecord (6.0.0) lib/active_record/connection_handling.rb:199:in `connection' activerecord (6.0.0) lib/active_record/migration.rb:562:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call' activesupport (6.0.0) lib/active_support/callbacks.rb:101:in `run_callbacks' actionpack (6.0.0) lib/action_dispatch/middleware/callbacks.rb:26:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/executor.rb:14:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call' web-console (3.3.0) lib/web_console/middleware.rb:131:in `call_app' web-console (3.3.0) lib/web_console/middleware.rb:20:in `block in call' web-console (3.3.0) lib/web_console/middleware.rb:18:in `catch' web-console (3.3.0) lib/web_console/middleware.rb:18:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' railties (6.0.0) lib/rails/rack/logger.rb:38:in `call_app' railties (6.0.0) lib/rails/rack/logger.rb:26:in `block in call' activesupport (6.0.0) lib/active_support/tagged_logging.rb:80:in `block in tagged' activesupport (6.0.0) lib/active_support/tagged_logging.rb:28:in `tagged' activesupport (6.0.0) lib/active_support/tagged_logging.rb:80:in `tagged' railties (6.0.0) lib/rails/rack/logger.rb:26:in `call' sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/request_id.rb:27:in `call' rack (2.0.7) lib/rack/method_override.rb:22:in `call' rack (2.0.7) lib/rack/runtime.rb:22:in `call' activesupport (6.0.0) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/executor.rb:14:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/static.rb:126:in `call' rack (2.0.7) lib/rack/sendfile.rb:111:in `call' actionpack (6.0.0) lib/action_dispatch/middleware/host_authorization.rb:83:in `call' webpacker (4.0.0) lib/webpacker/dev_server_proxy.rb:29:in `perform_request' rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call' railties (6.0.0) lib/rails/engine.rb:526:in `call' puma (4.2.1) lib/puma/configuration.rb:228:in `call' puma (4.2.1) lib/puma/server.rb:667:in `handle_request' puma (4.2.1) lib/puma/server.rb:470:in `process_client' puma (4.2.1) lib/puma/server.rb:328:in `block in run' puma (4.2.1) lib/puma/thread_pool.rb:134:in `block in spawn_thread'
試したこと
①No connection pool with 'primary' found.
エラーが表示される前にSQLite(3.7.17)のバージョンが古いとのメッセージが出たため、Gemfileを書き換えました。下記がGemfileの中身です。
Ruby
1git_source(:github) { |repo| "https://github.com/#{repo}.git" } 2 3ruby '2.6.3' 4 5# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 6gem 'rails', '6.0.0' 7# Use Puma as the app server 8gem 'puma', '4.2.1' 9# Use SCSS for stylesheets 10gem 'sass-rails', '6.0.0' 11# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker 12gem 'webpacker', '4.0' 13# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 14gem 'turbolinks', '5' 15# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 16gem 'jbuilder', '2.7' 17# Use Redis adapter to run Action Cable in production 18# gem 'redis', '4.0' 19# Use Active Model has_secure_password 20# gem 'bcrypt', '3.1.7' 21 22# Use Active Storage variant 23# gem 'image_processing', '1.2' 24 25# Reduces boot times through caching; required in config/boot.rb 26gem 'bootsnap', require: false 27 28group :development, :test do 29 # Use sqlite3 as the database for Active Record 30 gem 'sqlite3', '~> 1.3.6' 31 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 32 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 33end 34 35group :development do 36 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 37 gem 'web-console', '3.3.0' 38 gem 'listen', '3.2.0' 39 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 40 gem 'spring' 41 gem 'spring-watcher-listen', '2.0.0' 42end 43 44group :test do 45 # Adds support for Capybara system testing and selenium driver 46 gem 'capybara', '2.15' 47 gem 'selenium-webdriver' 48 # Easy installation and use of web drivers to run system tests with browsers 49 gem 'webdrivers' 50end 51 52# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 53gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 54
②Gemfile書き換え後、bundle install
実行
③rails s
コマンドを実行するとActiveRecordエラーが生じたためサーバーを再起動
補足情報(FW/ツールのバージョンなど)
・macOS Catalina 10.15
・Ruby 2.6.3
・Rails 6.0.0
・bundler 2.0.2
・sqlite3 1.3.13
よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/11/03 06:14
2019/11/03 06:19