Since that didn't work, I deleted the dbi directories from e:\ruby\bin, and copied the "dbi" and "dbd_mysql" dir to the folder I'm currently creating my project in. In that folder I ran this file:
../dbi/dbi.rb:499:in `load_driver': is not a class/module (TypeError)
from ./dbi/dbi.rb:401:in `_get_full_driver'
from ./dbi/dbi.rb:381:in `connect'
from import.rb:3
Can someone please explain this to me, why it isn't work, and how I can fix it? I can't get any further till I can at least connect to the MySQL db I created.
Since that didn't work, I deleted the dbi
directories from e:\ruby\bin,
and copied the "dbi" and "dbd_mysql" dir to the
folder I'm currently
creating my project in.
<snip>
I will recommend that you delete the files:
E:\ruby\bin\sqlsh.rb
and
E:\ruby\bin\proxyserver.rb
Then delete
E:\ruby\lib\ruby\site_ruby\1.8\dbi.rb.
Finally get rid of the folders:
E:\ruby\lib\ruby\site_ruby\1.8\DBD
and
E:\ruby\lib\ruby\site_ruby\1.8\DBI
Since that didn't work, I deleted the dbi directories from e:\ruby\bin, and copied the "dbi" and "dbd_mysql" dir to the folder I'm currently creating my project in. In that folder I ran this file:
You have to put the file from directory dbd_mysql into a directory named DBD/Mysql, i.e. there must be a file DBD/Mysql/Mysql.rb somewhere.
../dbi/dbi.rb:499:in `load_driver': is not a class/module (TypeError)
from ./dbi/dbi.rb:401:in `_get_full_driver'
from ./dbi/dbi.rb:381:in `connect'
from import.rb:3
Can someone please explain this to me, why it isn't work, and how I can fix it? I can't get any further till I can at least connect to the MySQL db I created.
../dbi/dbi.rb:499:in `load_driver': is not a class/module (TypeError)
from ./dbi/dbi.rb:401:in `_get_full_driver'
from ./dbi/dbi.rb:381:in `connect'
from import.rb:3
Can someone please explain this to me, why it isn't work, and how I can fix it? I can't get any further till I can at least connect to the MySQL db I created.
It can't find the driver due to a wrong location.
Hope this helps.
Regards,
Michael
I got it installed correctly now, but still getting the "load_driver" error.
I think I've missed s step somewhere. Up until now I've been using MySQL with PHP, and with PHP I just have to install MySQL and then everything works. I'm guessing I'll need to install the driver or API first to make this work?
So, what do I need to do to make Ruby work with MySQL? I'm using WinXP, MySQL4, and Windows version of Ruby 1.8.0.
I've downloaded mysql-ruby-2.4.5.tar.gz, but when I type in:
ruby extconf.rb --with-mysql-dir=e:\mysql, I get:
checking for mysql_query() in mysqlclient.lib... no
checking for main() in m.lib... yes
checking for mysql_query() in mysqlclient.lib... no
checking for main() in z.lib... no
checking for mysql_query() in mysqlclient.lib... no
checking for main() in socket.lib... no
checking for mysql_query() in mysqlclient.lib... no
checking for main() in nsl.lib... no
checking for mysql_query() in mysqlclient.lib... no
Guess I'm still new to using databases in places other than PHP, would be appreciated if someone could guide me through the process.
Robo <robo@mars.com> emerged reluctantly from the curtain and
staggered drunkenly up to the mic. In a cracked and slurred voice
he muttered:
So, what do I need to do to make Ruby work with MySQL? I'm using
WinXP, MySQL4, and Windows version of Ruby 1.8.0.
To the best of my knowledge, so far nobody has updated the MySQL
package to work on Windows with any Ruby version higher than 1.6.
Which seems like a tragic oversight in my mind. Nor have any
details been left as to how the original porting was made.
I''ve had to fall back on the Ruby-MySQL dirver. Which has the same
API as the C driver, only implemented in pure Ruby code. It's not
quite as fast, but it works.
I could be wrong here, You could be right
Please forgive me I have sinned - Not on your life
But that's how you want me, But I'll never fear thee
Why you and not me? Tell me Holy Man
../dbi/dbi.rb:499:in `load_driver': is not a class/module (TypeError)
from ./dbi/dbi.rb:401:in `_get_full_driver'
from ./dbi/dbi.rb:381:in `connect'
from import.rb:3
Can someone please explain this to me, why it isn't work, and how I can fix it? I can't get any further till I can at least connect to the MySQL db I created.
It can't find the driver due to a wrong location.
Hope this helps.
Regards,
Michael
I got it installed correctly now, but still getting the "load_driver" error.
Then it can't load the required ruby-mysql (or mysql-ruby) library.
I think I've missed s step somewhere. Up until now I've been using MySQL with PHP, and with PHP I just have to install MySQL and then everything works. I'm guessing I'll need to install the driver or API first to make this work?
Exactly. You need to either install ruby-mysql or mysql-ruby (see RAA, Ruby's Application Archive: raa.ruby-lang.org).