An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue.

Last updated on February 24th, 2019 at 02:55 pm

Gem files will remain installed in /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2 for inspection.
Results logged to /var/www/discourse/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/mysql2-0.5.2/gem_make.out
An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue.
Make sure that gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/' succeeds before bundling.
In Gemfile:
mysql2

I found the best way to solve the problem.

I think that you may missing the dev library of mysql:

On ubuntu

sudo apt-get install libmysqlclient-dev

On Red Hat/CentOS and other distributions using yum:

sudo yum install mysql-devel

On Mac OS X with Homebrew:

brew install mysql

Tags:

2 thoughts on “An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue.”

Comments are closed.

Discover more from Juzhax Technology

Subscribe now to keep reading and get access to the full archive.

Continue reading