# Undefined method \`query' for class \`Mysql'

**URL:** <https://www.ruby-forum.com/t/undefined-method-query-for-class-mysql/181131>\
**Category:** Rails\
**Created:** [January 6, 2010, 1:06am UTC](https://www.ruby-forum.com/t/undefined-method-query-for-class-mysql/181131 "2010-01-06T01:06:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thelemcke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@thelemcke](https://www.ruby-forum.com/u/thelemcke)\
**Post date:** [January 6, 2010, 1:06am UTC](https://www.ruby-forum.com/t/undefined-method-query-for-class-mysql/181131/1 "2010-01-06T01:06:44Z")

</div>

help!

Just installed clean install of rails (2.3.2), ruby (1.8.7), and mysql  
(5.1), and when I try to run “rake db:migrate” on an existing rails  
app I get the following error:

undefined method `query' for class`Mysql’

---

<div class="post-metadata">

**Author:** ![thelemcke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@thelemcke](https://www.ruby-forum.com/u/thelemcke)\
**Post date:** [January 6, 2010, 2:21am UTC](https://www.ruby-forum.com/t/undefined-method-query-for-class-mysql/181131/2 "2010-01-06T02:21:39Z")

</div>

I was able to resolve this issue with this article:

> **[techskater.com - This website is for sale! - techskater...](http://www.techskater.com/ruby-on-rails/problems-with-mysql-gem-and-rake-on-snow-leopard/)**
>
> This website is for sale! techskater.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, techskater.com has it all. We hope you find what you are...

---

<div class="post-metadata">

**Author:** ![thelemcke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@thelemcke](https://www.ruby-forum.com/u/thelemcke)\
**Post date:** [January 6, 2010, 8:35am UTC](https://www.ruby-forum.com/t/undefined-method-query-for-class-mysql/181131/3 "2010-01-06T08:35:06Z")

</div>

On Tue, Jan 5, 2010 at 4:04 PM, theLemcke [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> help!
> 
> Just installed clean install of rails (2.3.2), ruby (1.8.7), and mysql  
> (5.1), and when I try to run “rake db:migrate” on an existing rails  
> app I get the following error:
> 
> undefined method `query' for class `Mysql’

First, what platform are you working with? How did you exactly install  
‘mysql’? For  
example, if you’re using Snow Leopard, did you use MacPorts, Fink, or  
other?  
Next,  
did you properly install the Mysql database adapter:

sudo gem install mysql

-Conrad

ps: When
