i have been trying to successfully connect ruby with mysql. there are a
hundred examples with code and some using different gems.
gems i have tried:
mysql
mysql2
dbi
ruby-mysql
the code examples i have found have been pretty much the same so im
guessing its something with the gems, maybe they are not installing
right, i tried moving them around to different files but it didnt make a
difference.
i have also read that mysql gem is not supported....so i want to start
with a question before i post any code or ask for any code,
does anyone know of a ruby-mysql gem that they have gotten to work, (by
work i mean connect to mysql database, and interact with mysql through
ruby)
does anyone know of a ruby-mysql gem that they have gotten to work, (by
work i mean connect to mysql database, and interact with mysql through
ruby)
I can't speak for MySQL, but I've been using DBI with a PostgreSQL database for a project with simple database needs, and after the initial setup it has been fairly low-hassle to use. If I had to talk to a MySQL database at this point I'd try DBI first, but that's just me, and it could be bad advice.
As a point of reference, I'm using DBI 0.4.5 with Ruby 1.9.2 p136 at present on this project.
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require': cannot load such fil
e -- mysql (LoadError)
from
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'
from C:/Users/will/Notepad++/Databases/ruby_DBI.rb:11:in
`<main>'
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require': cannot load such fil
e -- mysql (LoadError)
from
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'
from C:/Users/will/Notepad++/Databases/ruby_DBI.rb:1:in `<main>'
I just tried reinstalling ruby, i installed the devkit. i do have vmware
with ubuntu and bt5 that i could use, but im more comfortable with
windows. do you know of any other database that works well with ruby
that i could try?
I will try to figure out the issue with the gem not being found, i read
a page a while ago about different ways to install the gem....i think
with a -r switch or something ill see if i can find that again and
reinstall and see if that does anything.
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require': cannot load such file -- mysql (LoadError)
You say this same thing happens with any gem; that means your
ruby/rubygems installation is broken. Unfortunately I have no idea
how to troubleshoot that on Windows.
You might try re-installing from scratch. Or just sidestep the pain and
install a VM with some Linux distro.
Otherwise, perhaps someone with Windows experience will be able
to suggest something. Sorry.
···
On Sun, Nov 25, 2012 at 9:34 AM, john smith <lists@ruby-forum.com> wrote:
I just tried reinstalling ruby, i installed the devkit. i do have vmware
with ubuntu and bt5 that i could use, but im more comfortable with
windows. do you know of any other database that works well with ruby
that i could try?
I don't understand Ruby, nevertheless I installed Redmine in our office. So,
when we moved to Ruby 1.9.3 I had to use mysql2 gem, not mysql. My advice is
to try mysql2.
mysql2 requires newer version of libmysql.dll (6.0.2)
···
--
Regards,
Ivan Cenov
OKTO-7 Co. Bulgaria
imc@okto7.com, i_cenov@botevgrad.com
mobile:+359888761080,
phone:+35972366161, fax:+_35972366262
This has nothing whatsoever to do with a particular DB. MySQL
with the mysql or mysql2 gem works fine "with ruby".
It's the fact that your program can't find the gem in the first place
that you need to address.
···
On Sun, Nov 25, 2012 at 10:39 AM, john smith <lists@ruby-forum.com> wrote:
I just tried reinstalling ruby, i installed the devkit. i do have vmware
with ubuntu and bt5 that i could use, but im more comfortable with
windows. do you know of any other database that works well with ruby
that i could try?
I just tried reinstalling ruby, i installed the devkit. i do have vmware
with ubuntu and bt5 that i could use, but im more comfortable with
windows. do you know of any other database that works well with ruby
that i could try?
I don't understand Ruby, nevertheless I installed Redmine in our office.
So,
when we moved to Ruby 1.9.3 I had to use mysql2 gem, not mysql. My
advice is
to try mysql2.
mysql2 requires newer version of libmysql.dll (6.0.2)
--
Regards,
Ivan Cenov
OKTO-7 Co. Bulgaria
imc@okto7.com, i_cenov@botevgrad.com
mobile:+359888761080,
phone:+35972366161, fax:+_35972366262
It was the libmysql.dll file, when you d/l the mysql 2.9.0 it said:
You've installed the binary version of mysql.
It was built using MySQL Connector/C version 6.0.2.
It's recommended to use the exact same version to avoid potential
issues.
At the time of building this gem, the necessary DLL files where
available
in the following URL:
I just tried reinstalling ruby, i installed the devkit. i do have vmware
with ubuntu and bt5 that i could use, but im more comfortable with
windows. do you know of any other database that works well with ruby
that i could try?
I don't understand Ruby, nevertheless I installed Redmine in our office.
So,
when we moved to Ruby 1.9.3 I had to use mysql2 gem, not mysql. My
advice is
to try mysql2.
mysql2 requires newer version of libmysql.dll (6.0.2)
--
Regards,
Ivan Cenov
OKTO-7 Co. Bulgaria
imc@okto7.com, i_cenov@botevgrad.com
mobile:+359888761080,
phone:+35972366161, fax:+_35972366262
It was the libmysql.dll file, when you d/l the mysql 2.9.0 it said:
You've installed the binary version of mysql.
It was built using MySQL Connector/C version 6.0.2.
It's recommended to use the exact same version to avoid potential
issues.
At the time of building this gem, the necessary DLL files where
available
in the following URL:
On Monday, 26 November 2012 at 11:56 AM, Travis Johnson wrote:
Please unsubscribe me from this list. Thanks!
On Nov 25, 2012, at 7:26 PM, john smith wrote:
> Jon Forums wrote in post #1086333:
> > > You can put the lib\libmysql.dll available in this package to your
> > > Ruby bin directory.
> > > E.g. C:\Ruby\bin
> > >
> > > Go to website unzip and place the libmysql.dll file in your ruby/bin
> > > folder. thanks for all the help
> >
> >
> >
> > Don't forget that you've got the RubyInstaller group as a resource if
> > you're not getting decent windows specific answers here.
> >
> > Here's the search results with "mysql".
> >
> > Redirecting to Google Groups
> >
> > Also, briefly describe your system when posting. No one knew you were
> > trying to use mysql on a windows system or your ruby version.
> >
> > Jon
>
> I will remember to mention my system and ruby version next time. thank
> you.
>
> --
> Posted via http://www.ruby-forum.com/\.