From: salamond Date: 2011-08-29T14:45:58+09:00 Subject: Re: Connecting Ruby and MySQL Looks to me, you're installing mysql gem successfully, but not the build mysql_api successfully. While installing mysql, you will need to provide mysql lib or mysql dir, to help gem to build your mysql_api.so While using gem install mysql, gem usually hides this error. To fix this, I suggest you download a ruby-mysql-2.8.1.tar.gz source code. $ gem uninstall mysql $ gem list --local # see mysql uninstalled $ tar xvzf ruby-mysql-2.8.1.gz $ ruby ext-conf.rb $ make $ make install This is the exact step gem use to install mysql on your machine, but by doing this step by step, you will see what's going wrong. If you need to provide mysql lib or mysql dir during install, you are doing the right thing. On Mon, Aug 29, 2011 at 6:58 AM, jake kaiden wrote: > amir e. wrote in post #1018955: >> I installed MySQL 5.5 ( mysql-installer-5.5.15.0.msi ) and mysql gem ( >> with "gem install mysql" command ) > >> "C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in >> `require': 126: The specified module could not be found.   - >> C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/1.9/mysql_api.so >> (LoadError)" >> > >  judging from the error it looks like mysql was not installed > properly...  maybe you're missing dependencies?  try: > > "gem install -r mysql" > >  ...which should also install any dependencies you are missing. > >> #my = Mysql.new(hostname, username, password, databasename) > >  ...once you get mysql installed properly, i imagine you'll want to > change this line.  the pound sign ("#") makes it a comment, and > therefore the variable "my" is never defined, it should probably look > like this: > >  my = Mysql.new(hostname, username, password, databasename) > >  ...you'll also have to define all of those variables (hostname, > username, password, databasename,) otherwise it's going nowhere! > > >  good luck, > >  - j > > -- > Posted via http://www.ruby-forum.com/. > >