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