AWSでRailsをデプロイする際に、表題のエラーがでてしまい。詰まっ出ております、ネット上の記事などを参照したのですが、解決できませんでした。
ruby -v
ruby 2.2.3p173
今回のエラー内容
LoadError: /usr/lib64/mysql/libmysqlclient.so.18: version `libmysqlclient_16' not found (required by /var/project_name/shared/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/mysql2-0.3.20/mysql2/mysql2.so) - /var/project_name/shared/bundle/v
ruby/2.2.0/extensions/x86_64-linux/2. 2.0-static/mysql2-0.3p173.20/mysql2/mysql2.so
今回のエラー内容
LoadError: /usr/lib64/mysql/libmysqlclient.so.18: version `libmysqlclient_16' not found (required by /var/project_name/shared/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/mysql2-0.3.20/mysql2/mysql2.so) - /var/project_name/shared/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/mysql2-0.3.20/mysql2/mysql2.so
↑のこの記事でいうの
$ ldd /usr/lib64/mysql/libmysqlclient.so.18
$ ldd /usr/lib64/mysql/libmysqlclient.so.18
のところまではは同じように設定し、結果も同じのものが帰っ返っております。
※mysqlのバージョンも上記は記事と同じバージョンに合わせております。
ldd .rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/mysql2-0.3.18/mysql2/mysql2.so
ldd .rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18/ext/mysql2/mysql2.so
ldd .rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18/lib/mysql2/mysql2.so
ldd .rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/mysql2-0.3.18/mysql2/mysql2.so
ldd .rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18/ext/mysql2/mysql2.so
ldd .rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18/lib/mysql2/mysql2.so
の
.rbenv.rbenv
というのがそもそもなかったため、
$ pwd
/var/project_name/releases/20160605065652
$ pwd
/var/project_name/releases/20160605065652
$ which rbenv
/usr/local/rbenv/bin/rbenv
$ which rbenv
/usr/local/rbenv/bin/rbenv
socketはrailsのdatabase.ymlとあわせて、
/tmp/mysql.sock
に/tmp/mysql.sock
に統一しております。
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/tmp/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
explicit_defaults_for_timestamp=1
skip-grant-tables
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
socket=/tmp/mysql.sock
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/tmp/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
explicit_defaults_for_timestamp=1
skip-grant-tables
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
socket=/tmp/mysql.sock