From: Joe L Date: 2007-12-05T12:42:44+09:00 Subject: Re: Ruby works but not JRuby - when using MySQL Driver --0-1577271591-1196825940=:71510 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit I'm not sure if this is the case, but seems like it might be. JRuby doesn't support C extensions. I don't know if it can be addressed with that driver. You might be able to use the Java MySQL Driver, keep in mind the free one is GPL. If I'm wrong about anything, someone correct me. Joe Venks wrote: Here is the simple Ruby program that works with "Ruby" but gives an error with "JRuby". file: connection.rb ================================================ #!/usr/bin/ruby -w # Use Ruby MySQL module to test connection information require "mysql" begin dbh = Mysql.real_connect("mars", "csread", "csread", "csapp") puts "Server Info: " + dbh.get_server_info rescue Mysql::Error => e puts "Error code: #{e.errno}" puts "Error message: #{e.error}" puts "Error SQLSTATE: #{e.sqlstate}" if e.respond_to?("sqlstate") ensure dbh.close if dbh end ==================================================== Below is the error while running with JRuby: connection.rb:4: /usr/lib/ruby/gems/1.8/gems/mysql-2.7/mysql.so:0: Invalid char `\177' in expression (SyntaxError) from connection.rb:4:in `require' from connection.rb:4 Is this a compatibility issue between JRuby and MySQL driver writting in Ruby? Is this expected behaviour or can this be addressed? Thanks, --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. --0-1577271591-1196825940=:71510--