# Minor issue with mysql/ruby - major headache

**URL:** <https://www.ruby-forum.com/t/minor-issue-with-mysql-ruby-major-headache/57109>\
**Category:** Rails\
**Created:** [April 7, 2006, 8:51am UTC](https://www.ruby-forum.com/t/minor-issue-with-mysql-ruby-major-headache/57109 "2006-04-07T08:51:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![charl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@charl](https://www.ruby-forum.com/u/charl)\
**Post date:** [April 7, 2006, 8:51am UTC](https://www.ruby-forum.com/t/minor-issue-with-mysql-ruby-major-headache/57109/1 "2006-04-07T08:51:31Z")

</div>

i hope its minor,

i’m running lighty1.4x ruby 1.8x mysql 5.0.1x and i can see my rails app  
on 127.0.0.1:3000 but if i try run a app with database connection  
(scaffold) i get this error  
NameError in Message#index

uninitialized constant Mysql

RAILS\_ROOT: ./config/…  
Application Trace | Framework Trace | Full Trace

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:195:in  
`const_missing' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:35:in `mysql\_connection’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:145:in  
`send’  
if i run the same app with webrick it works. i have a feeling it is the  
mysql\_ruby GEM which i haven’t got working in sync with ruby. I followed  
the instruction on [http://www.jjleonard.co.uk/?p=102](http://www.jjleonard.co.uk/?p=102) "copy mysql.rb to  
the ruby install directory, typically c:\ruby\lib\ruby\1.8" i  
downloaded this version ruby-mysql-0.2.6.tar.gz. is there anything else  
i need to do?

thanks for anyone who can offer any advice

---

<div class="post-metadata">

**Author:** ![charl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@charl](https://www.ruby-forum.com/u/charl)\
**Post date:** [April 14, 2006, 11:58pm UTC](https://www.ruby-forum.com/t/minor-issue-with-mysql-ruby-major-headache/57109/2 "2006-04-14T23:58:39Z")

</div>

charl wrote:

> i hope its minor,
> 
> i’m running lighty1.4x ruby 1.8x mysql 5.0.1x and i can see my rails app  
> on 127.0.0.1:3000 but if i try run a app with database connection  
> (scaffold) i get this error  
> NameError in Message#index
> 
> uninitialized constant Mysql

I’ve ran into a situtation in Windows where the MySQL lib was not being  
found when the path to the MySQL dlls was the last item in the systems  
PATH variable and did not end with a semicolon. The fix for me was  
simply to add that semicolon.

---

<div class="post-metadata">

**Author:** ![charl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@charl](https://www.ruby-forum.com/u/charl)\
**Post date:** [April 14, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/minor-issue-with-mysql-ruby-major-headache/57109/3 "2006-04-14T19:20:38Z")

</div>

> uninitialized constant Mysql

RAILS\_ROOT: ./config/…  
Application Trace | Framework Trace | Full Trace

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:195:in  
`const_missing' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:35:in `mysql\_connection’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:145:in

> `send’

someone else had a similar problem to me and he found this fix  
[http://www.ruby-forum.com/topic/8061#63856](http://www.ruby-forum.com/topic/8061#63856)

it definately works now, strange one.
