Monday, May 23, 2011

Myslq2 on Ubuntu 10.04

Tried to get mysql2 adapter installed on Ubuntu 10.4 today. I just found out this existed. Its been a little while since I have coded some Rails. I'm working on 3.0.1. I also had an issue updating my gems, but I let that slide for today. I Thought that would be as easy as 'sudo gem install mysql2', but that didn't really work out.
I get an error:
ERROR: Could not find a valid gem 'myslq2' (>= 0) in any repository

I first installed libmysqlclient-dev:
sudo apt-get install libmysqlclient-dev

Then I realized I needed to change my Gemfile, which is totally new to me. I added this line and removed sqlite:

gem 'mysql2', '< 0.3'

Then I ran:
bundle install

That got it to start working.

No comments:

Post a Comment