ec2-user:~/environment/talkle2 (master) $ heroku run rails db:migrate (node:4651) SyntaxError Plugin: heroku: /home/ec2-user/.cache/heroku/version: Unexpected end of JSON input module: @oclif/config@1.13.2 task: runHook init plugin: heroku root: /home/ec2-user/.local/share/heroku/client/7.47.7 See more details with DEBUG=* Running rails db:migrate on ⬢ talkle... up, run.7886 (Free) rails aborted! Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) /app/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `connect' /app/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `initialize' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `new' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `mysql2_connection' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in `new_connection' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:874:in `checkout_new_connection' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in `try_to_checkout_new_connection' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:814:in `acquire_connection' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:538:in `checkout' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:1033:in `retrieve_connection' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_handling.rb:118:in `retrieve_connection' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/connection_handling.rb:90:in `connection' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/tasks/database_tasks.rb:172:in `migrate' /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.4/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>' /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/commands/rake/rake_command.rb:23:in `block in perform' /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/commands/rake/rake_command.rb:20:in `perform' /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/command.rb:48:in `invoke' /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.4/lib/rails/commands.rb:18:in `<top (required)>' /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:291:in `block in require' /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:257:in `load_dependency' /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:291:in `require' /app/bin/rails:9:in `<main>' Tasks: TOP => db:migrate (See full trace by running task with --trace) ```herokuにデプロイをしたときにmigrateをしたらこのようなえらーになりました。いろいろ調べてみましたが原因がわかりません。 socket '/var/lib/mysql/mysql.sock'は直接ファイルを書き換えましたが治りませんでした。(元の状態に戻しました)
あなたの回答
tips
プレビュー