# Mysql-ruby module errors

**URL:** <https://www.ruby-forum.com/t/mysql-ruby-module-errors/67985>\
**Category:** Ruby\
**Created:** [September 8, 2006, 9:55am UTC](https://www.ruby-forum.com/t/mysql-ruby-module-errors/67985 "2006-09-08T09:55:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [September 8, 2006, 9:55am UTC](https://www.ruby-forum.com/t/mysql-ruby-module-errors/67985/1 "2006-09-08T09:55:28Z")

</div>

Im trying to install mysql-ruby on windows 2000.  
I thought version 2.7.1 installed properly  
even when I got a failed installation of 2.7.0

the command I used was “gem install mysql”.

That seemed to work perfectly so I  
ran a mysql-ruby test program from  
[http://www.kitebird.com/articles/ruby-mysql.html](http://www.kitebird.com/articles/ruby-mysql.html).

I was thrown this ruby error. Does this mean that Mysql.2.7.1 didnt  
install properly either?

> ruby simple.rb  
> C:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.1-mswin32/ext/mysql.so: 126:  
> The specified module could not be found.  
> -c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.1-mswin32/ext/mysql.so  
>   
> from

c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:33:in  
‘require’ from simple.rb1

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [September 8, 2006, 5:47pm UTC](https://www.ruby-forum.com/t/mysql-ruby-module-errors/67985/2 "2006-09-08T17:47:26Z")

</div>

I also should mention a window pops up after running the command

> ruby simple.rb

the window says

ruby.exe - Unable to Locate Component.

this application has failed to start because LIBMYSQL.dll was not found.  
Re-installing the application may fix this problem.

Does that help any more with what this problem is?  
What should I do?

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [October 30, 2006, 8:30pm UTC](https://www.ruby-forum.com/t/mysql-ruby-module-errors/67985/3 "2006-10-30T20:30:51Z")

</div>

You probably figured this out by now, but for those that are having the  
same problem, this is caused by the libmysql.dll not being on your path.  
Essentially, that means that you have to make sure that the DLL is on  
your path before running ruby, for example:

set PATH=%PATH%;c:\progra~1\mysql50\lib\opt;c:\progra~1\mysql50\include;  
ruby script.server

If you are running 64bit MySQL and 32bit Ruby, you will need to download  
the 32-bit libmysql.dll from [mysql.com](http://mysql.com) (e.g. by downloading the 32bit  
MySQL zip package) and set the path to point to that.

Cheers,  
Nick

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [November 2, 2006, 3:58pm UTC](https://www.ruby-forum.com/t/mysql-ruby-module-errors/67985/4 "2006-11-02T15:58:58Z")

</div>

My fix was reinstalling a few times till I got everything working.
