- 1 year ago
PGP key issue while trying to install mysql2 in rails project
Comment
1 / 1
The mysql2
gem relies on a C library called libmysqlclient
to communicate with the MySQL database. In some cases, the installation of mysql2
may fail due to issues with the PGP key that is used to sign the libmysqlclient
package.
To resolve this issue, you can try the following steps:
Import the PGP key:
shwget https://repo.mysql.com/RPM-GPG-KEY-mysql
sudo rpm --import RPM-GPG-KEY-mysql
Install the
libmysqlclient
package:shsudo yum install mysql-community-devel
Install the
mysql2
gem:shgem install mysql2
If these steps do not work, you can try installing the mysql2
gem from source:
Download the
mysql2
source code from GitHub:shgit clone https://github.com/brianmario/mysql2.git
Change to the
mysql2
directory:shcd mysql2
Build the gem:
shgem build mysql2.gemspec
Install the gem:
shgem install mysql2-<version>.gem
Replace <version>
with the version number of the mysql2
gem that you just built.