Problems installing mysql gem Ubuntu

Well here’s the deal, after updating Ruby on Rails you realized it actually needs the mysql gem installed to work. So you went to your console and typed:
$ sudo gem install mysql.
But then you got some nice error:

ERROR: While executing gem … (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.

Well the thing is that this gem needs the dev packages to compile and install so you got to install the mysql dev library:
$ sudo apt-get install libmysqlclient15-dev
Now lets go back to our gem installation:
$ sudo gem install mysql.
There you go, your mysql gem is now installed properly.
Recommend Me


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: