Ruby 1.9, Ruby Mysql 2.8, Compiling

M

mwlang88

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
 
M

mwlang88

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

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.
 
R

Roger Pack

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?
 
M

mwlang88

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?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top