Imran
Imran

Reputation: 11654

MySQL error when running `rails server`

I get the following error when I run rails server

Could not find mysql2-0.2.7 in any of the sources

Any ideas? How do i fix this?

Thanks in advance ;-)

Upvotes: 1

Views: 1820

Answers (2)

Mike Farmer
Mike Farmer

Reputation: 2992

You need to go read up on Bundler: http://gembundler.com/

Bundler is included in Rails 3 by default. At the root of your app is a file called

Gemfile

You should only use mysql or mysql2. I recommend mysql2 so if you have more than one in your Gemfile then remove the others. Then make sure you run bundle install.

For complete instructions on setting up MySQL and Rails on OSX, check out this blog post:

Preferred Rails 3 and MySQL Installation on OSX Snow Leopard

Upvotes: 0

SomeDudeSomewhere
SomeDudeSomewhere

Reputation: 3940

If for some reason you have the version number specified next to the gem, try removing it, just do

gem 'mysql2' in your Gemfile,

Then run "bundle install", that should do it

Upvotes: 1

Related Questions