Library not loaded when trying to upgrade the version of ruby and rails s

Error excerpt

/Users/hoge-user/projects/freee-auth/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': dlopen(/Users/hoge-user/projects/freee-auth/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError)
  Referenced from: /Users/hoge-user/projects/freee-auth/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.bundle
  Reason: image not found - /Users/hoge-user/projects/freee-auth/vendor/bundle/ruby/2.6.0/gems/mysql2-0.4.10/lib/mysql2/mysql2.bundle

Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError) Because it says bundle doctor

The following gems are missing OS dependencies:
 * mysql2: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
 * mysql2: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

It says something is missing from the openssl family that mysql depends on. Is it because openssl was replaced with the version upgrade of ruby? So reinstall mysql and re-install the dependent gem libraries

bundle exec gem uninstall mysql2
bundle install #mysql gem should also be included

rails s worked fine

$ bundle exec rails s -p 3099
=> Booting Puma
=> Rails 5.2.4.3 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 4.3.1 (ruby 2.6.6-p146), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://127.0.0.1:3099
* Listening on tcp://[::1]:3099

Recommended Posts

Library not loaded when trying to upgrade the version of ruby and rails s
Project ruby and rails version upgrade
[Rails] [Memo] When to add = to <%%> and when not
rails error Library not loaded
[Rails] When the layout change of devise is not reflected
How to solve the problem when the value is not sent when the form is disabled in rails and sent
I get a Ruby version error when I try to start Rails.
[Rails] What to do when rails s does not respond or does not stop
[Rails] Read the RSS of the site and return the contents to the front
Things to remember and concepts in the Ruby on Rails tutorial
What to do if the app is not created with the latest Rails version installed when rails new
Method definition location Summary of how to check When defined in the project and Rails / Gem
Update JAVA to the latest version to 1.8.0_144 (when downloading from the web and updating)
A note of someone who stumbled when trying to create a Rails project
[Ruby] I want to extract only the value of the hash and only the key
How to constrain the action of the transition destination when not logged in
How to solve the local environment construction of Ruby on Rails (MAC)!
[Rails] The cause of not being able to post was in form_with
Ruby on Rails When you don't know the cause of rollback when saving.
[Rails] Articles for beginners to organize and understand the flow of form_with
Change the save destination of the image to S3 in the Rails app. Part 2
[Easy] How to upgrade Ruby and bundler
[Rails] What to do when the Refile image is not displayed when writing the processing at the time of Routing Error
[Ruby on Rails] How to make the link destination part of the specified id
[Promotion of Ruby comprehension (1)] When switching from Java to Ruby, first understand the difference.
[Ruby on Rails] Change the update date and creation date to your favorite notation
[heroku deployment procedure ③] From Ruby version specification to deployment and access to the application (complete)
Introduce Docker to the development environment and test environment of existing Rails and MySQL applications
[Ruby on Rails] How to Japaneseize the error message of Form object (ActiveModel)
Check the version of the JDK installed and the version of the JDK enabled
[Rails] Button to return to the top of the page
[Ruby on Rails] Until the introduction of RSpec
[Rails] I tried to raise the Rails version from 5.0 to 5.2
[Java] Access the signed URL of s3 (signed version 2)
What to do when ‘Could not find’ in any of the sources appears in the development environment with Docker × Rails × RSpec
When the Ruby on Rails terminal rolls back
Manage the version of Ruby itself with rbenv
Ruby on Rails ~ Basics of MVC and Router ~
When changing the Controller of Spring Web MVC to kotlin, @Autowired The specified component is not injected and becomes null.
Final confirmation when ruby version does not switch
Does not recognize the library when implementing jcaptcha
[Ruby on Rails] Implementation of validation that works only when the conditions are met
[rails] After option useful when you want to change the order of DB columns
[In team development] Error when moving to another member's branch and doing rails s [Rails]
[Ruby on rails] When executing the heroku command, bash: heroku: command not found is displayed. [Rails tutorial]
[Rough explanation] How to separate the operation of the production environment and the development environment with Rails
Explanation of Ruby on rails for beginners ④ ~ Naming convention and how to use form_Tag ~
When the hover of Eclipse is hard to see
Convert the array of errors.full_messages to characters and output
[Ruby on Rails] How to change the column name
[Ruby] How to use rbenv (version `x.x.x'is not installed)
[Technical memo] About the advantages and disadvantages of Ruby
[Rails] How to get the contents of strong parameters
[Ruby] Class nesting, inheritance, and the basics of self
How to download the old version of Apache Tomcat
(Ruby on Rails6) How to create models and tables
Try using the query attribute of Ruby on Rails
[Ruby on Rails] I get a warning when executing RSpec due to a different gem version.
What to do if you installed Ruby with rbenv but the version does not change
The version of Ruby that was installed by default on the Mac was referenced, not from rbenv
[Rails] How to temporarily save the request URL of a user who is not logged in and return to that URL after logging in