質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.44%
Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

619閲覧

rails起動時TypeErrorになる

828kk88

総合スコア61

Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2023/03/14 16:10

編集2023/03/14 16:13

railsのバージョンアップを行っていたところ、起動ができなくなりました
以下エラー内容です

=> Booting WEBrick => Rails 6.1.7 application starting in development http://localhost:3000 => Run `bin/rails server --help` for more startup options [2023-03-15 00:53:46] INFO WEBrick 1.8.1 [2023-03-15 00:53:46] INFO ruby 3.1.3 (2022-11-24) [arm64-darwin21] [2023-03-15 00:53:46] INFO WEBrick::HTTPServer#start: pid=2045 port=3000 Started GET "/" for ::1 at 2023-03-15 00:53:53 +0900 TypeError (no implicit conversion of Hash into String): mysql2 (0.5.0) lib/mysql2/error.rb:55:in `encode' mysql2 (0.5.0) lib/mysql2/error.rb:55:in `initialize' mysql2 (0.5.0) lib/mysql2/error.rb:62:in `new' mysql2 (0.5.0) lib/mysql2/error.rb:62:in `new_with_args' mysql2 (0.5.0) lib/mysql2/client.rb:90:in `connect' mysql2 (0.5.0) lib/mysql2/client.rb:90:in `initialize' activerecord (6.1.7) lib/active_record/connection_adapters/mysql2_adapter.rb:40:in `new' activerecord (6.1.7) lib/active_record/connection_adapters/mysql2_adapter.rb:40:in `new_client' activerecord (6.1.7) lib/active_record/connection_adapters/mysql2_adapter.rb:23:in `mysql2_connection' activerecord (6.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send' activerecord (6.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection' activerecord (6.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection' activerecord (6.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection' activerecord (6.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection' activerecord (6.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout' activerecord (6.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection' activerecord (6.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection' activerecord (6.1.7) lib/active_record/connection_handling.rb:327:in `retrieve_connection' activerecord (6.1.7) lib/active_record/connection_handling.rb:283:in `connection' activerecord (6.1.7) lib/active_record/migration.rb:611:in `connection' activerecord (6.1.7) lib/active_record/migration.rb:606:in `build_watcher' activerecord (6.1.7) lib/active_record/migration.rb:588:in `block in call' activerecord (6.1.7) lib/active_record/migration.rb:587:in `synchronize' activerecord (6.1.7) lib/active_record/migration.rb:587:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call' activesupport (6.1.7) lib/active_support/callbacks.rb:98:in `run_callbacks' actionpack (6.1.7) lib/action_dispatch/middleware/callbacks.rb:26:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/executor.rb:14:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call' web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call' web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch' web-console (2.3.0) lib/web_console/middleware.rb:18:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' railties (6.1.7) lib/rails/rack/logger.rb:37:in `call_app' railties (6.1.7) lib/rails/rack/logger.rb:26:in `block in call' activesupport (6.1.7) lib/active_support/tagged_logging.rb:99:in `block in tagged' activesupport (6.1.7) lib/active_support/tagged_logging.rb:37:in `tagged' activesupport (6.1.7) lib/active_support/tagged_logging.rb:99:in `tagged' railties (6.1.7) lib/rails/rack/logger.rb:26:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/request_id.rb:26:in `call' rack (2.2.6.4) lib/rack/method_override.rb:24:in `call' rack (2.2.6.4) lib/rack/runtime.rb:22:in `call' activesupport (6.1.7) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/executor.rb:14:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/static.rb:24:in `call' rack (2.2.6.4) lib/rack/sendfile.rb:110:in `call' actionpack (6.1.7) lib/action_dispatch/middleware/host_authorization.rb:148:in `call' railties (6.1.7) lib/rails/engine.rb:539:in `call' rack (2.2.6.4) lib/rack/handler/webrick.rb:95:in `service' webrick (1.8.1) lib/webrick/httpserver.rb:140:in `service' webrick (1.8.1) lib/webrick/httpserver.rb:96:in `run' webrick (1.8.1) lib/webrick/server.rb:310:in `block in start_thread' NameError: uninitialized constant Mime::HTML from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/web-console-2.3.0/lib/web_console/middleware.rb:58:in `acceptable_content_type?' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/web-console-2.3.0/lib/web_console/middleware.rb:36:in `block in call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/web-console-2.3.0/lib/web_console/middleware.rb:18:in `catch' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/web-console-2.3.0/lib/web_console/middleware.rb:18:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/railties-6.1.7/lib/rails/rack/logger.rb:37:in `call_app' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/railties-6.1.7/lib/rails/rack/logger.rb:26:in `block in call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7/lib/active_support/tagged_logging.rb:99:in `block in tagged' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7/lib/active_support/tagged_logging.rb:37:in `tagged' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7/lib/active_support/tagged_logging.rb:99:in `tagged' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/railties-6.1.7/lib/rails/rack/logger.rb:26:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7/lib/action_dispatch/middleware/remote_ip.rb:81:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7/lib/action_dispatch/middleware/request_id.rb:26:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.4/lib/rack/method_override.rb:24:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.4/lib/rack/runtime.rb:22:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7/lib/action_dispatch/middleware/executor.rb:14:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.4/lib/rack/sendfile.rb:110:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7/lib/action_dispatch/middleware/host_authorization.rb:148:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/railties-6.1.7/lib/rails/engine.rb:539:in `call' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.4/lib/rack/handler/webrick.rb:95:in `service' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:140:in `service' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:96:in `run' from /Users/oshita/pros/bbs/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/server.rb:310:in `block in start_thread' ::1 - - [15/Mar/2023:00:53:53 JST] "GET / HTTP/1.1" 500 1477 - -> /

試したこと

2つのTypeErrorが出ているようですが、ググっても似たような話が出ておらず困っています。
なにか解決策をご存じの方はいないでしょうか?

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

TypeErrorの内容はあまり関係なく、DB周りの問題でした
こちらの記事が参考になりました
https://qiita.com/Marchan4/questions/f267fde7bab719bc1620

投稿2023/03/14 16:28

828kk88

総合スコア61

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.44%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問