简体   繁体   中英

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;-)

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM