Guys, I am new here. I love Ruby, and after years I have decided to get
a project going. I installed Ruby 2.0, got the new Glade and GTK up, and
Visual Ruby. My plan was to build me a simple GUI that connects to a
core, which in turn connects to a MySQL database that I have prepared
ahead of time. I installed the current XAMPP package for a simple MySQL
installation and a decent admin.
I have attempted several different approaches to fix this problem and
now I am turning to the experts. The problem must be simple, but I am
going nuts. I installed the mysql gem with “gem install”… and allow
me to show you some of my code:
require ‘rubygems’
require ‘mysql’
class DatabaseCommunicator
def initialize(path, login, password, databaseName, table)
@path = path
@login = login
@password = password
@databaseName = databaseName
@table = table
end
def addSafebag(safeBagID, shop, employeeName, date)
begin
dbh = Mysql.new(@path, @login, @password, @databaseName)
return "Data entered! "
rescue Mysql::Error
exit 1
return "Oh crap! no database connectivity!"
end
end
end
I mean it’s straight forward enough right? Now this is where it really
grinds me. I get this error message:
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- mysql/mysql_api (LoadError) from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
require’
from
C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1-x86-mingw32/lib/mysql.rb:6:in
rescue in <top (required)>' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1-x86-mingw32/lib/mysql.rb:2:in
<top (required)>’
from
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in
require' from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in
rescue in require’
from
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in
`require’
I am at my wits end here. I tried DBI, that didn’t work. I tried RDBI,
that also didn’t work. No matter what tutorial I look at, or which
forum I search through for answers, I simply cannot come to the
conclusion. Is there anyone here who can help me?
-Jason