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?
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 <venkatesh.mantha@gmail.com> 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
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.
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.
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.
I installed this driver using "gem install mysql". I suppose this will
install MySQL/Ruby driver but I need Ruby/MySQL which is pure Ruby
MySQL driver. Is that correct?
On Dec 5, 2007 2:31 AM, Charles Oliver Nutter <charles.nutter@sun.com> 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.
I am not able to make the pure Ruby Mysql driver work. I am getting
the following error and couldn't figure out why this error is showing
up. MySQL manual mentions something about old client and password but
I am using MySQL 5.1 and I have no other version installed previously.
Of course I never had any issues with the Native Ruby MySQL driver.
Any ideas?
Error message: Client does not support authentication protocol
requested by server; consider upgrading MySQL client
···
On Dec 5, 2007 2:31 AM, Charles Oliver Nutter <charles.nutter@sun.com> 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.
On Dec 5, 2007 9:04 AM, Venks <venkatesh.mantha@gmail.com> wrote:
I am not able to make the pure Ruby Mysql driver work. I am getting
the following error and couldn't figure out why this error is showing
up. MySQL manual mentions something about old client and password but
I am using MySQL 5.1 and I have no other version installed previously.
Of course I never had any issues with the Native Ruby MySQL driver.
Any ideas?
Error message: Client does not support authentication protocol
requested by server; consider upgrading MySQL client
On Dec 5, 2007 2:31 AM, Charles Oliver Nutter <charles.nutter@sun.com> 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.
>
> - Charlie
>
>
That's unusual, since rails works fine with the pure-ruby mysql driver. However, if you're looking to use mysql directly, perhaps you should look into using JDBC instead? I'm sure we can find a good example if you're interesed in that. JDBC provides a uniform interface to basically any database.
Yes. Please send me any examples you may have. I already got one from
this mailing-list which I haven't tried yet. But don't mind receiving
few from you.
At this stage, JDBC seems to like the best option given that I need to
to communicate 2 different databases and one of them has only JDBC
interface and other is MySQL for which I will use JDBC too. Since JDBC
is my only option, JRuby will be the default choice.
Thanks,
···
On Dec 5, 2007 4:37 PM, Charles Oliver Nutter <charles.nutter@sun.com> wrote:
Venks wrote:
> According to the information here, pure Ruby MySQL doesn't work with
> 4.1 or 5.x. If that's true, I am not sure if pure Ruby MySQL is of any
> use.
>
> http://wiki.rubyonrails.org/rails/pages/MySQL
That's unusual, since rails works fine with the pure-ruby mysql driver.
However, if you're looking to use mysql directly, perhaps you should
look into using JDBC instead? I'm sure we can find a good example if
you're interesed in that. JDBC provides a uniform interface to basically
any database.
Yes. Please send me any examples you may have. I already got one from
this mailing-list which I haven't tried yet. But don't mind receiving
few from you.
At this stage, JDBC seems to like the best option given that I need to
to communicate 2 different databases and one of them has only JDBC
interface and other is MySQL for which I will use JDBC too. Since JDBC
is my only option, JRuby will be the default choice.
Here's a very simple example to get you into the JDBC frame of mind. This is basically a portion of the code shown at