Question

I am using Windows 7 and creating connection to MySQL2. I need to install gem. I am following these steps. Could someone please review them:

  1. Add the following to the Gemfile: gem 'mysql2', '~> 0.3.15'

  2. Run the following in cmd: gem install mysql2 -v '0.3.15'

  3. Go to the application using cmd and run this code: bundle install

When I perform step (3), I get the following error:

An error occurred while installing mysql2 (0.3.15), and bundler cannot continue make sure that `gem install mysql2 -v "0.3.15" ' succeeds before bundling..

My application resides on the D drive and I am using Windows 7.

Was it helpful?

Solution

I have found a solution that works on Ubuntu.

My mistake was that had not installed the my-sql library before trying to connect.

Please follow these steps to do this. Run the following commands:

sudo apt-get install mysql-client libmysqlclient-dev

sudo gem install mysql2

Add the following to the gemfile

gem 'mysql2', '~> 0.3.15'

And then run:

bundle install
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top