Я пытаюсь подключить свое Rails-приложение к MySQL, управляемому Digital Oceans, и мне не везет.Запуск Rails 6, Ruby 2.6.3 - Ошибка довольно неоднозначна для меня:
00:30 deploy:migrating
01 $HOME/.rbenv/bin/rbenv exec bundle exec rake db:migrate
01 rake aborted!
01 Mysql2::Error::ConnectionError: SSL connection error: unknown error number
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `connect'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `initialize'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/mysql2_adapter.rb:24:in `new'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/mysql2_adapter.rb:24:in `mysql2_connection'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:879:in `new_connection'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:923:in `checkout_new_connection'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:902:in `try_to_checkout_new_connec…
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:863:in `acquire_connection'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:587:in `checkout'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:431:in `connection'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:1111:in `retrieve_connection'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_handling.rb:231:in `retrieve_connection'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/connection_handling.rb:199:in `connection'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/tasks/database_tasks.rb:238:in `migrate'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/railties/databases.rake:85:in `block (3 levels) in <main>'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/railties/databases.rake:83:in `each'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/activerecord-6.0.0/lib/active_record/railties/databases.rake:83:in `block (2 levels) in <main>'
01 /home/deploy/my_app/shared/bundle/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
01 /home/deploy/.rbenv/versions/2.6.3/bin/bundle:23:in `load'
01 /home/deploy/.rbenv/versions/2.6.3/bin/bundle:23:in `<main>'
01 Tasks: TOP => db:migrate
01 (See full trace by running task with --trace)
#<Thread:0x00007fd33a9096a0@/Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
13: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
12: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:31:in `run'
11: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
10: from /Users/me/.rvm/gems/ruby-2.6.3/gems/capistrano-rails-1.4.0/lib/capistrano/tasks/migrations.rake:23:in `block (3 levels) in <top (required)>'
9: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:92:in `within'
8: from /Users/me/.rvm/gems/ruby-2.6.3/gems/capistrano-rails-1.4.0/lib/capistrano/tasks/migrations.rake:24:in `block (4 levels) in <top (required)>'
7: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:100:in `with'
6: from /Users/me/.rvm/gems/ruby-2.6.3/gems/capistrano-rails-1.4.0/lib/capistrano/tasks/migrations.rake:25:in `block (5 levels) in <top (required)>'
5: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:80:in `execute'
4: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
3: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:148:in `tap'
2: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
1: from /Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/backends/netssh.rb:170:in `execute_command'
/Users/me/.rvm/gems/ruby-2.6.3/gems/sshkit-1.20.0/lib/sshkit/command.rb:97:in `exit_status=': rake exit status: 1 (SSHKit::Command::Failed)
rake stdout: Nothing written
rake stderr: rake aborted!
My.cnf:
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
log-error = /var/log/mysql/error.log
# bind-address = 0.0.0.0
bind-address = *
require_secure_transport = ON
Database.yml (строка URL-адреса, предоставленная цифровым океаном)
production:
adapter: mysql2
url: mysql2://doadmin:alkdfjlsdkjfl@my-app-mysql-do-user-65417-0.db.ondigitalocean.com/defaultdb?ssl-mode=REQUIRED
pool: 15
timeout: 5000
sslca: /home/deploy/ca-certificate.crt
socket: /var/run/mysqld/mysqld.sock