# Upgrade to Snow Leopard gives me closed stream in rails 2.3.4

**URL:** <https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919>\
**Category:** Rails\
**Created:** [October 8, 2009, 9:24am UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919 "2009-10-08T09:24:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartOn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MartOn](https://www.ruby-forum.com/u/MartOn)\
**Post date:** [October 8, 2009, 9:24am UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919/1 "2009-10-08T09:24:58Z")

</div>

Hello  
After upgrading to Snow Leopard, I get a veird error on Mysql.  
The error is:  
IOError (closed stream)  
IOError (closed stream):  
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/  
1.8/mysql.rb:1032:in `sync=' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb:1032:in`write’  
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/  
1.8/mysql.rb:1092:in `finalizer' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb:578:in`call’  
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/  
1.8/mysql.rb:578:in `start' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/mysql.rb:578:in`free’  
app/controllers/admin/booker\_controller.rb:6

If I refresh the page, it will come 90% of the time (so not always).  
It seems to be some kind of timeout issue.

I have done all the 64bits upgrading of MySQL.

1. Installed the 64 bit version of MySQL
2. Installed the gems version of mysql adapter via  
sudo env ARCHFLAGS=â€-arch x86\_64â€³ gem install mysql â€” â€“with-mysql  
config=/usr/local/mysql/bin/mysql\_config

This installs, but I get this warnings on the mysql ruby install:  
Successfully installed mysql-2.8.1  
1 gem installed  
Installing ri documentation for mysql-2.8.1â€¦

No definition for next\_result

No definition for field\_name

No definition for field\_table

No definition for field\_def

No definition for field\_type

No definition for field\_length

No definition for field\_max\_length

No definition for field\_flags

No definition for field\_decimals

I have tried also the MAMP installed MYSQL server, so I think this is  
a bug in the ruby mysql.

Any Ideas?

/MartOn

---

<div class="post-metadata">

**Author:** ![MartOn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MartOn](https://www.ruby-forum.com/u/MartOn)\
**Post date:** [October 8, 2009, 9:34am UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919/2 "2009-10-08T09:34:20Z")

</div>

The instructions upgrading MySQL are contained in the following post:

> **[Upgrading to Snow Leopard](https://rubyonrails.org/2009/8/30/upgrading-to-snow-leopard)**
>
> Last Friday, Apple released their new OS version: Snow Leopard. Upgrading to SL is very easy and even gives you back quite a lot of HD space.However a few things have changed in the OS and you need to understand what is going on so you won’t get...

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![MartOn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MartOn](https://www.ruby-forum.com/u/MartOn)\
**Post date:** [October 8, 2009, 11:02am UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919/3 "2009-10-08T11:02:09Z")

</div>

What’s an example of a query that you’re trying to run? Your initial  
e-mail  
didn’tprovide any details of what you have and have not done. So, what  
does  
it mean  
to run bigger queries so that I can try to reproduce here?

Thanks,

-Conrad

---

<div class="post-metadata">

**Author:** ![MartOn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MartOn](https://www.ruby-forum.com/u/MartOn)\
**Post date:** [October 8, 2009, 9:46am UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919/4 "2009-10-08T09:46:37Z")

</div>

It is exactly what I have already done. And for small queries it works  
perfectly. It is just when I do bigger queries that takes time I get  
this “closed stream” error.

/MartOn

---

<div class="post-metadata">

**Author:** ![MartOn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MartOn](https://www.ruby-forum.com/u/MartOn)\
**Post date:** [October 8, 2009, 11:19am UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919/5 "2009-10-08T11:19:09Z")

</div>

I tested downloading ruby 1.8.7 and compiling and installing to /usr/  
local. That fixed the problem.  
Now it is running ok. Not sure why…

I will try to clean out all my gems and reinstall them on the native  
ruby in /usr/bin

/MartOn

---

<div class="post-metadata">

**Author:** ![MartOn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MartOn](https://www.ruby-forum.com/u/MartOn)\
**Post date:** [October 8, 2009, 11:44am UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919/6 "2009-10-08T11:44:19Z")

</div>

So, I just tried to wipe out my gems on native ruby install and  
reinstall rails and mysql.  
that ended with the same “closed stream” error…  
this must be a bug in the ruby version in /usr/bin.

If I switch back to the /usr/local version I just compiled everything  
is working perfectly.

Any ideas on how I can do further investigation?

/MartOn

---

<div class="post-metadata">

**Author:** ![MartOn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MartOn](https://www.ruby-forum.com/u/MartOn)\
**Post date:** [October 8, 2009, 12:38pm UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919/7 "2009-10-08T12:38:11Z")

</div>

On Thu, Oct 8, 2009 at 2:42 AM, MartOn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> So, I just tried to wipe out my gems on native ruby install and  
> reinstall rails and mysql.

You really don’t need to remove anything because you just need to  
recompile  
all your native gems. Did you do this?

> that ended with the same “closed stream” error…  
> this must be a bug in the ruby version in /usr/bin.

What query are you trying to run? What’s the size of the result-set?

> If I switch back to the /usr/local version I just compiled everything  
> is working perfectly.
> 
> Any ideas on how I can do further investigation?

What’s an example query that you’re trying to run? Please provide the  
exact statements that you’re trying to execute.

-Conrad

---

<div class="post-metadata">

**Author:** ![MartOn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MartOn](https://www.ruby-forum.com/u/MartOn)\
**Post date:** [October 9, 2009, 10:23pm UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919/8 "2009-10-09T22:23:41Z")

</div>

There is not a specific query that fails.  
I know I do not have to wipe out gems. But sine I did, all gems ARE  
recompiled when I test.

I also know that Snow has its built in ruby 1.8.7. Thats what I am  
trying to explain here.  
When I use the ruby 1.8.7 that comes with Snow, then I get this  
strange MySQL error.

If I compile ruby my self, I do not get it.

That is my problem now. I can live with this, since everything is  
working perfectly now using ruby from usr/local.

I just think it is strange.

/MartOn

---

<div class="post-metadata">

**Author:** ![MartOn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@MartOn](https://www.ruby-forum.com/u/MartOn)\
**Post date:** [October 8, 2009, 11:50am UTC](https://www.ruby-forum.com/t/upgrade-to-snow-leopard-gives-me-closed-stream-in-rails-2-3-4/176919/9 "2009-10-08T11:50:10Z")

</div>

Hi, you’ll have to reinstall all your native gems and this also include  
Rubygems or you’ll have other problems. Next, I didn’t have to install  
Ruby  
1.8.7 because it was part of Snow Leopard. Thus, I don’t understand why  
you  
had to install it being that it’s the default.

-Conrad
