# Mysql gem causing migrations to fail :P

**URL:** <https://www.ruby-forum.com/t/mysql-gem-causing-migrations-to-fail-p/124774>\
**Category:** Rails\
**Created:** [January 2, 2008, 2:34pm UTC](https://www.ruby-forum.com/t/mysql-gem-causing-migrations-to-fail-p/124774 "2008-01-02T14:34:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Collin\_VanDyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/839c29/32.png) [@Collin\_VanDyck](https://www.ruby-forum.com/u/Collin_VanDyck)\
**Post date:** [January 2, 2008, 2:34pm UTC](https://www.ruby-forum.com/t/mysql-gem-causing-migrations-to-fail-p/124774/1 "2008-01-02T14:34:20Z")

</div>

I have run into a weird problem recently after I upgraded my ruby  
installation from 1.8.5 to 1.8.6. Every time I run a migration on my  
production machine, the migration fails with a segmentation fault:

$ rake db:migrate RAILS\_ENV=production  
(in /home/site.com/web/rails/releases/20071231141335)  
/opt/csw/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active\_record/  
connection\_adapters/mysql\_adapter.rb:333: [BUG] Segmentation fault  
ruby 1.8.6 (2007-09-24) [i386-solaris2.11]  
Abort (core dumped)

If I remove the MySQL gem, the migration works. I have tried removing  
and reinstalling MySQL, Rails, and Rake, all without any success.

Regarding the actual error, it’s occurring when the migration executes  
SHOW KEYS FROM #{table\_name}. The MySQL query log shows that many of  
these commands are being executed successfully, and then after a  
certain number of SQL commands the ruby / rake process segfaults.

Any ideas? I’m pretty stuck and would appreciate any suggestions…

---

<div class="post-metadata">

**Author:** ![Collin\_VanDyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/839c29/32.png) [@Collin\_VanDyck](https://www.ruby-forum.com/u/Collin_VanDyck)\
**Post date:** [January 2, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/mysql-gem-causing-migrations-to-fail-p/124774/2 "2008-01-02T14:51:55Z")

</div>

On 2 Jan 2008, at 13:33, Collin VanDyck wrote:

> Abort (core dumped)
> 
> If I remove the MySQL gem, the migration works. I have tried removing  
> and reinstalling MySQL, Rails, and Rake, all without any success.
> 
> Regarding the actual error, it’s occurring when the migration executes  
> SHOW KEYS FROM #{table\_name}. The MySQL query log shows that many of  
> these commands are being executed successfully, and then after a  
> certain number of SQL commands the ruby / rake process segfaults.
> 
> Any ideas? I’m pretty stuck and would appreciate any suggestions…  
> Have you tried recompiling the mysql gem against the new version of  
> ruby ?

Fred

---

<div class="post-metadata">

**Author:** ![Collin\_VanDyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/839c29/32.png) [@Collin\_VanDyck](https://www.ruby-forum.com/u/Collin_VanDyck)\
**Post date:** [January 2, 2008, 3:42pm UTC](https://www.ruby-forum.com/t/mysql-gem-causing-migrations-to-fail-p/124774/3 "2008-01-02T15:42:58Z")

</div>

> Have you tried recompiling the mysql gem against the new version of  
> ruby ?
> 
> Fred

I did:

$ sudo gem uninstall mysql  
$ sudo gem install mysql

Both of which completed successfully.

---

<div class="post-metadata">

**Author:** ![Collin\_VanDyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/839c29/32.png) [@Collin\_VanDyck](https://www.ruby-forum.com/u/Collin_VanDyck)\
**Post date:** [January 3, 2008, 12:11am UTC](https://www.ruby-forum.com/t/mysql-gem-causing-migrations-to-fail-p/124774/4 "2008-01-03T00:11:34Z")

</div>

## If the migrations and possibly everything else works without the gem, just leave it uninstalled.

Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.
