Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundler won't install mysql2

First of all I've gone through dozens of posting here on SO and google and haven't been able to find an answer. I'm trying to install mysql2 with bundler and it won't do it.

Running on Ubuntu Server 11.04 Natty

Here's some background info:

ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]

gem -v
1.8.24

rails -v
Rails 3.2.5

$ mysql --version
mysql  Ver 14.14 Distrib 5.1.62, for debian-linux-gnu (x86_64) using readline 6.2

I have gem "mysql2", "~> 0.3.11" in my Gemfile

When I do bundle install it goes through the process and it finishes successfully (No Errors) but it doesn't install mysql2. When I do bundle show, mysql2 is not listed.

I've tried a gazillion of things recommended here and on forums and still can't get mysql2 to install with bundler.

Any ideas?

Thanks.

like image 529
wonitta Avatar asked Dec 15 '22 22:12

wonitta


1 Answers

For mysql2 you need to install the dev files on your server.

try first:

sudo apt-get install libmysqlclient-dev

Then check first your GemFile in your RoR App Dir - I have this line in my GemFile:

gem 'mysql2', '0.3.11'

run bundle:

bundle install

or try the command from Emily first then run bundle install:

gem install mysql2 -v=0.3.11
bundle install

I hope it helps

like image 149
theforce Avatar answered Dec 30 '22 23:12

theforce