Ruby 1.9, Ruby Mysql 2.8, Compiling


#1

Hello, all

I have successfully compiled and install Ruby 1.9.1.rc2 on 32-bit
Ubuntu Intrepid.

I have also managed to compile the Ruby MySQL 2.8 native bindings.

I eventually got everything going to run Rails 2.2.2 on Ruby 1.9 and
connecting to a MySQL database with the native drivers. However, when
I hit a page that then hits the databsae, the Webrick 1.3.1 server
simply bombs with an immediate exit reporting the following:

$ script/server
=> Booting WEBrick…
/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.2.2/lib/
action_controller/routing/segments.rb:6: warning: encoding option is
ignored - N
=> Rails 2.2.2 application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2009-01-29 13:57:32] INFO WEBrick 1.3.1
[2009-01-29 13:57:32] INFO ruby 1.9.1 (2009-01-20) [i686-linux]
[2009-01-29 13:57:32] INFO WEBrick::HTTPServer#start: pid=17957
port=3000
ruby: symbol lookup error: /usr/local/lib/ruby/site_ruby/1.9.1/i686-
linux/mysql.so: undefined symbol: rb_thread_stop_timer

Figuring I simply forgot to compile in thread support, I went back and
recompiled Ruby 1.9 with --enable-pthread, recompiled the mysql
extensions and reinstalled everything. Still getting the same error,
I decided to grep the Ruby code and found a rb_thread_stop_timer_thread
(), but no rb_thread_stop_timer() could be found anywhere in the Ruby
code base!

So what’s the deal? Where does rb_stop_thread_timer() come from?

One other thing I would like to mention, I commented out the
rb_start_thread_timer() and rb_stop_thread_timer() calls in the
mysql.c file and recompiled and reinstalled. To my utter surprise, I
had a functioning Rails application hitting a mysql database and
returning rendered pages with data! So, regardless of where
rb_stop_thread_timer() comes from, is it safe to remove these thread
guards from the mysql extension? If not safe, then I’m stuck with
either finding the providers for rb_thread_stop_timer() or changing to
what may be the new calls, rb_thread_stop_timer_thread(), but I’m no
expert with ‘C’ so can’t make a sound judgment call myself.

Michael


#2

So what’s the deal? Where does rb_stop_thread_timer() come from?

I think it’s from 1.8 and mysql lib isn’t quite 1.9 compat
you could try mysqlplus which seems to at least compile on 1.9
-=r
http://github.com/oldmoe/mysqlplus/tree/master


#3

If you know of a blog or some documentation with getting a mysqlplus
adapter installed into Rails env, I’d be much obliged.

doing a
require ‘mysqlplus’
at the top of environment.rb should [?] work?


#4

On Jan 29, 3:19 pm, Roger P. removed_email_address@domain.invalid wrote:

So what’s the deal? Where does rb_stop_thread_timer() come from?

I think it’s from 1.8 and mysql lib isn’t quite 1.9 compat
you could try mysqlplus which seems to at least compile on 1.9
-=rhttp://github.com/oldmoe/mysqlplus/tree/master

Posted viahttp://www.ruby-forum.com/.

Thanks! That gets me a working mysql connector in a straight IRB
session, but I seem to be going down some slippery slope with finding
the mysqlplus adapters for Rails…googling around has me trying out
the neverblock and eventengine in order to get a “neverblock_mysql”
driver. I wasn’t able to get Mongrel going on 1.9, but I did get Thin
going. However, I just get blank pages all around with a “you have a
nil object where you probably didn’t expected” emitted on the Thin
console.

If you know of a blog or some documentation with getting a mysqlplus
adapter installed into Rails env, I’d be much obliged.


#5

On Jan 30, 10:14 am, Roger P. removed_email_address@domain.invalid wrote:

If you know of a blog or some documentation with getting a mysqlplus
adapter installed into Rails env, I’d be much obliged.

doing a
require ‘mysqlplus’
at the top of environment.rb should [?] work?

Posted viahttp://www.ruby-forum.com/.

Good gosh. Wish I’d tried that at the outset, but nooo, I had to go
the hard way and got into neverblock, eventengine, etc. which actually
had some documentation on how to use non-blocking mysql with rails
(I’m still working on compiling and configuring all this).

But circling back, removing the hacked mysql 2.8 C-bound library and
requiring ‘mysqlplus’ did the trick, an amazingly simple, too! Thanks
for your help!

Michael