Charles Murray
Charles Murray

Reputation: 383

rails mysql server error "could not find gem"

When I try to run "rails server" on a new project it returns

Could not find gem 'mysql2 (>= 0) X86-mingw32' in any of the gem sources listed in your Gemfile. 
Run 'bundle install' to install missing gems.

I ran 'bundle install' but I'm getting the same error.

I already had mysql installed from the xampp package, but my friend helped me install rails so I'm not sure how he configured it. I use Windows Vista.

Upvotes: 3

Views: 4064

Answers (4)

Francis Lewis
Francis Lewis

Reputation: 8980

I had a similar issue, but when trying to gem install mysql2, it would give me a can't find header files for ruby at ... error message.

Running this fixed the issue for me: sudo apt-get install ruby-dev

Upvotes: 0

Plant More Trees
Plant More Trees

Reputation: 65

I had a similar issue. For me, I needed to remove the old Gemfile.lock and allow it be re-generated by running bundle update after I added the same version of mysql to the Gemfile that I had installed via "gem install mysql".

This may or may not be the issue you were running in to, but it appears this error message -> "Could not find gem 'mysql'" can be caused for this reason as well.

Upvotes: 0

mrmonroe
mrmonroe

Reputation: 325

I ran into this issue a while back setting up a RoR dev environment on a windows machine. Had to copy the dll to the ruby/bin folder. See the thread from ruby-forum... http://www.ruby-forum.com/topic/150580

Upvotes: 1

Justin D.
Justin D.

Reputation: 4976

Try gem install mysql2. It should then work.

Upvotes: 2

Related Questions