# Ruby 1.9.1, Test/Unit, and EventMachine

**URL:** <https://www.ruby-forum.com/t/ruby-1-9-1-test-unit-and-eventmachine/159168>\
**Category:** Ruby\
**Created:** [February 1, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/ruby-1-9-1-test-unit-and-eventmachine/159168 "2009-02-01T19:52:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elliottcable](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@elliottcable](https://www.ruby-forum.com/u/elliottcable)\
**Post date:** [February 1, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/ruby-1-9-1-test-unit-and-eventmachine/159168/1 "2009-02-01T19:52:11Z")

</div>

I’m trying to install my second gem after updating to Ruby 1.9.1, and  
I’m having problems.

First of all, I found that I couldn’t install EventMachine as it was,  
because it depended on Test/Unit which is apparently not bundled with  
Ruby as of 1.9; so I ran `sudo gem install test-unit`. Everything  
appeared to go smoothly.

However, having cloned EventMachine from GitHub and built the gem, I  
get this error when trying to `gem install` the .gem file:

* * *

ã€ˆSun Feb 01 - 09:39:54ã€‰ã€ˆelliottcable - Geoffreyã€‰ã€ˆ~/Code/src/  
eventmachine/ã€‰ã€ˆmaster - ae1f407ã€‰  
âžœ gem install pkg/eventmachine-0.12.3.gem  
WARNING: Installing to ~/.gem since /usr/local/lib/ruby/gems/1.9.1  
and  
/usr/local/bin aren’t both writable.  
WARNING: You don’t have /Users/elliottcable/.gem/ruby/1.9.1/bin in  
your PATH,  
gem executables will not run.  
Building native extensions. This could take a while…  
ERROR: Error installing pkg/eventmachine-0.12.3.gem:  
ERROR: Failed to build gem native extension.

rake RUBYARCHDIR=/Users/elliottcable/.gem/ruby/1.9.1/gems/  
eventmachine-0.12.3/lib RUBYLIBDIR=/Users/elliottcable/.gem/ruby/1.9.1/  
gems/eventmachine-0.12.3/lib  
cd ext  
(in /Users/elliottcable/.gem/ruby/1.9.1/gems/eventmachine-0.12.3)  
checking for rb\_thread\_blocking\_region()… yes  
checking for RB\_UBF\_DFL in ruby.h… no  
checking for sys/event.h… yes  
checking for sys/queue.h… yes  
creating Makefile  
cd -  
cd ext  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o binder.o -c  
binder.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o cmain.o -c  
cmain.cpp  
cmain.cpp:501:2: warning: "/_" within comment  
cmain.cpp: In function â€˜int evma\_send\_file\_data\_to\_connection(const  
char_, const char\*)â€™:  
cmain.cpp:527: warning: comparison between signed and unsigned integer  
expressions  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o cplusplus.o  
-c cplusplus.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o ed.o -c  
ed.cpp  
ed.cpp: In constructor â€˜DatagramDescriptor::DatagramDescriptor(int,  
EventMachine\_t\*)â€™:  
ed.cpp:1058: warning: unused variable â€˜sobâ€™  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o em.o -c  
em.cpp  
em.h: In constructor â€˜EventMachine\_t::EventMachine\_t(void (_)(const  
char_, int, const char\*, int))â€™:  
em.h:144: warning: â€˜EventMachine\_t::bKqueueâ€™ will be initialized after  
em.h:142: warning: â€˜int EventMachine\_t::epfdâ€™  
em.cpp:73: warning: when initialized here  
em.cpp: In static member function â€˜static int  
EventMachine\_t::SetRlimitNofile(int)â€™:  
em.cpp:252: warning: comparison between signed and unsigned integer  
expressions  
em.cpp: In member function â€˜bool EventMachine\_t::\_RunKqueueOnce()â€™:  
em.cpp:580: warning: comparison between signed and unsigned integer  
expressions  
em.cpp: In member function â€˜const char\*  
EventMachine\_t::InstallOneshotTimer(int)â€™:  
em.cpp:881: warning: comparison between signed and unsigned integer  
expressions  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o emwin.o -c  
emwin.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o epoll.o -c  
epoll.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o files.o -c  
files.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o kb.o -c  
kb.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o page.o -c  
page.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o pipe.o -c  
pipe.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o rubymain.o -  
c rubymain.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o sigs.o -c  
sigs.cpp  
g++ -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.6.0 -I/usr/local/  
include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -  
DBUILD\_FOR\_RUBY -DHAVE\_RB\_THREAD\_BLOCKING\_REGION -DOS\_UNIX -  
DHAVE\_SYS\_EVENT\_H -DHAVE\_SYS\_QUEUE\_H -DHAVE\_KQUEUE -DWITH\_SSL -  
D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE -fno-common -O2 -g -Wall -Wno-  
parentheses -pipe -fno-common -I/opt/local/include -o ssl.o -c  
ssl.cpp  
g++ -dynamic -bundle -undefined suppress -flat\_namespace -o  
rubyeventmachine.bundle binder.o cmain.o cplusplus.o ed.o em.o emwin.o  
epoll.o files.o kb.o page.o pipe.o rubymain.o sigs.o ssl.o -L. -L/usr/  
local/lib -L. -L/usr/local/lib -L/opt/local/lib -lssl -lcrypto -  
lz -lpthread -ldl -lobjc  
cd -  
mv ext/rubyeventmachine.bundle lib  
Loaded suite tests/testem  
Started  
…/  
usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/unit/ui/  
console/testrunner.rb:141:in `flush': Bad file descriptor (Errno::EBADF) from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/ unit/ui/console/testrunner.rb:141:in`output\_single’  
from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/  
unit/ui/console/testrunner.rb:129:in `output' from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/ unit/ui/console/testrunner.rb:124:in`nl’  
from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/  
unit/ui/console/testrunner.rb:93:in `finished' from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/ unit/util/observable.rb:78:in`call’  
from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/  
unit/util/observable.rb:78:in `block in notify_listeners' from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/ unit/util/observable.rb:78:in`each’  
from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/  
unit/util/observable.rb:78:in `notify_listeners' from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/ unit/ui/testrunnermediator.rb:55:in`ensure in run\_suite’  
from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/  
unit/ui/testrunnermediator.rb:55:in `run_suite' from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/ unit/ui/console/testrunner.rb:74:in`start\_mediator’  
from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/  
unit/ui/console/testrunner.rb:46:in `start' from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/ unit/ui/testrunnerutilities.rb:24:in`run’  
from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/  
unit/autorunner.rb:269:in `run' from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/ unit/autorunner.rb:44:in`run’  
from /usr/local/lib/ruby/gems/1.9.1/gems/test-unit-2.0.2/lib/test/  
unit.rb:340:in `block in \<top (required)\>’  
rake aborted!  
Command failed with status (1): [/usr/local/bin/ruby -Ilib -Iext -  
Ijava tes…]

(See full trace by running task with --trace)

## Gem files will remain installed in /Users/elliottcable/.gem/ruby/1.9.1/ gems/eventmachine-0.12.3 for inspection. Results logged to /Users/elliottcable/.gem/ruby/1.9.1/gems/ eventmachine-0.12.3/gem\_make.out Updating class cache with 1318 classes…

I wouldn’t post this on this list, except that I’m not sure if the  
problem originates in EventMachine or Test/Unit or in changes  
introduced in 1.9.1. Any help is appreciated!

---

<div class="post-metadata">

**Author:** ![elliottcable](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@elliottcable](https://www.ruby-forum.com/u/elliottcable)\
**Post date:** [February 1, 2009, 9:52pm UTC](https://www.ruby-forum.com/t/ruby-1-9-1-test-unit-and-eventmachine/159168/2 "2009-02-01T21:52:45Z")

</div>

elliottcable wrote:

> I’m trying to install my second gem after updating to Ruby 1.9.1, and  
> I’m having problems.

Reports of Ruby 1.8’s death were greatly exaggerated. Go back!
