mysql2 gem hangs during installation

2019-09-09 20:46发布

问题:

I'm using mysql as the database for a rails app and trying to bundle install the mysql2 gem. During the step

Installing mysql2 0.3.19 with native extensions

rather than failing and giving me an error message, it simply hangs and never gives any output at all.

For background I'm installing on a fresh digital ocean droplet that comes with rails installed on Ubuntu 14.04, using ruby 2.0.0 and without specifying a version for the mysql2 gem.

回答1:

It looks like I had the wrong version of mysql installed. Uninstalling all versions of mysql and then running

sudo apt-get install mysql-client libmysqlclient-dev

worked for me.