hasen's tech life

Twitter: @hasen

bundle installでエラーが出たので対応した.

# bundle installでエラーが出たので対応した.

$ ./bin/bundle i
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /PATH/TO/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/ext/mysql2
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_wait_for_single_fd()... yes
checking for -lmysqlclient... no
-----
mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.
-----
*** extconf.rb failed ***

$ sudo yum remove -y mysql*
$ sudo yum install -y mysql mysql-devel
$ ./bin/bundle i
$ ./bin/rake db:migrate

Could not find rake-12.3.2 in any of the sources

$ sudo yum remove -y mysql*
$ sudo yum install -y mysql-server mysql-devel

$ ./bin/rake db:migrate

rails libmysqlclient.so.18: cannot open shared object file
$ ./bin/bundle exec gem uninstall mysql2
$ ./bin/bundle i