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:inrequire’
from C:/Users/will/Notepad++/Databases/ruby_DBI.rb:11:in
`’
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:inrequire’
from C:/Users/will/Notepad++/Databases/ruby_DBI.rb:1:in `’
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?
On Sun, Nov 25, 2012 at 9:34 AM, john smith [email protected]
wrote:
here is another attempt…
OK, stop right there –
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.
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)
On Sun, Nov 25, 2012 at 10:39 AM, john smith [email protected]
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?
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.
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.
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)
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: