# Ruby 1.9, Ruby Mysql 2.8, Compiling

**URL:** <https://www.ruby-forum.com/t/ruby-1-9-ruby-mysql-2-8-compiling/158961>\
**Category:** Ruby\
**Created:** [January 29, 2009, 8:32pm UTC](https://www.ruby-forum.com/t/ruby-1-9-ruby-mysql-2-8-compiling/158961 "2009-01-29T20:32:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwlang88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@mwlang88](https://www.ruby-forum.com/u/mwlang88)\
**Post date:** [January 29, 2009, 8:32pm UTC](https://www.ruby-forum.com/t/ruby-1-9-ruby-mysql-2-8-compiling/158961/1 "2009-01-29T20:32:16Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![mwlang88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@mwlang88](https://www.ruby-forum.com/u/mwlang88)\
**Post date:** [January 29, 2009, 9:21pm UTC](https://www.ruby-forum.com/t/ruby-1-9-ruby-mysql-2-8-compiling/158961/2 "2009-01-29T21:21:58Z")

</div>

> 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

> **[GitHub - oldmoe/mysqlplus: An enhanced mysql driver with an async interface and...](https://github.com/oldmoe/mysqlplus/tree/master)**
>
> master

---

<div class="post-metadata">

**Author:** ![mwlang88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@mwlang88](https://www.ruby-forum.com/u/mwlang88)\
**Post date:** [January 30, 2009, 4:17pm UTC](https://www.ruby-forum.com/t/ruby-1-9-ruby-mysql-2-8-compiling/158961/3 "2009-01-30T16:17:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mwlang88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@mwlang88](https://www.ruby-forum.com/u/mwlang88)\
**Post date:** [January 30, 2009, 1:40am UTC](https://www.ruby-forum.com/t/ruby-1-9-ruby-mysql-2-8-compiling/158961/4 "2009-01-30T01:40:54Z")

</div>

On Jan 29, 3:19 pm, Roger P. [removed\_email\_address@domain.invalid](mailto: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.

---

<div class="post-metadata">

**Author:** ![mwlang88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@mwlang88](https://www.ruby-forum.com/u/mwlang88)\
**Post date:** [January 31, 2009, 12:50pm UTC](https://www.ruby-forum.com/t/ruby-1-9-ruby-mysql-2-8-compiling/158961/5 "2009-01-31T12:50:58Z")

</div>

On Jan 30, 10:14 am, Roger P. [removed\_email\_address@domain.invalid](mailto: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
