S.Yadav
S.Yadav

Reputation: 4509

How to resolve Rails issue- An error occurred while installing mysql2 (0.4.4), and Bundler cannot continue

you may get this issue while working on Rails 4.0 and above version along with Ruby 2.0 and above.

this is very common issue if you are going ahead with up gradation of Rails environment.

Steps to be follow-

For Windows System-

1.Download the the newest mysql-connector to c:\mysql-connector folder
 2. gem install mysql2 -- '--with-mysql-include="C:\mysql-connector\include" --with-mysql-lib="C:\mysql-connector\lib"

Hopefully it will work for you. For Ubuntu System-

1. open terminal (Ctrl+alt+T)
2. $ sudo apt-get install libmysqld-dev
Run bundle from your project directory 
3. $ bundle

This will resolve the issue.We can also see the solution here.

https://randvblog.wordpress.com/2016/06/20/how-to-resolve-rails-issue-an-error-occurred-while-installing-mysql2-0-4-4-and-bundler-cannot-continue-make-sure-that-gem-install-mysql2-v-0-4-4-succeeds-before-bundling/

Upvotes: 1

Views: 1187

Answers (1)

S.Yadav
S.Yadav

Reputation: 4509

I got this issue resolved with following steps as-

  1. open terminal (Ctrl+alt+T)
  2. $ sudo apt-get install libmysqld-dev Run bundle from your project directory
  3. $ bundle
  4. rails s Now rails app is working fine.

Upvotes: 4

Related Questions