From: Charles Oliver Nutter Date: 2007-12-05T16:36:08+09:00 Subject: Re: Ruby works but not JRuby - when using MySQL Driver Charles Oliver Nutter wrote: > Venks wrote: >> 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? > > The pure Ruby MySQL driver should be fine, but it looks like you've got > the non-pure-Ruby driver and it's trying to load it. There's a known bug > in JRuby that it will try to load .so files as Ruby source (oops), but > no amount of magic will make it load native extensions (yet). > > Make sure you're using a pure Ruby MySQL driver if you want to access SQL. Or of course you could use JDBC directly. The API is pretty clean, a lot cleaner than many Java APIs. - charlie