# Ruby socket support

**URL:** <https://www.ruby-forum.com/t/ruby-socket-support/133989>\
**Category:** Ruby\
**Created:** [April 6, 2008, 4:30am UTC](https://www.ruby-forum.com/t/ruby-socket-support/133989 "2008-04-06T04:30:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![randall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b38774/32.png) [@randall](https://www.ruby-forum.com/u/randall)\
**Post date:** [April 6, 2008, 4:30am UTC](https://www.ruby-forum.com/t/ruby-socket-support/133989/1 "2008-04-06T04:30:25Z")

</div>

Hello all,

I’m getting this error trying to use use gems

/usr/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem\_original\_require’: no such file to load – socket (LoadError)

ruby and ruby gems is built against uclibc . I’m trying to figure out  
why ruby is not being built with socket support.

any ideas would be helpful

Thanks

zio

---

<div class="post-metadata">

**Author:** ![randall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b38774/32.png) [@randall](https://www.ruby-forum.com/u/randall)\
**Post date:** [April 6, 2008, 6:36am UTC](https://www.ruby-forum.com/t/ruby-socket-support/133989/2 "2008-04-06T06:36:22Z")

</div>

Mike Rosset wrote:

> any ideas would be helpful  
> A few years ago, I did some network programming on gumstix (uclibc) with  
> ruby, and they did work well. One thing is to make sure to build socket  
> statically (uncomment the line in ext/Setup before building ruby):

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/227140](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/227140)  
[http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/227140?226556-227545](http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/227140?226556-227545)

Just uncomment all the extensions you think you’ll need.

I had this configure option, too: --disable-ipv6. Not sure if that’s  
still needed.

I also had to hack configure.in a little (maybe it was for cross  
compiling?). My notes are below, but this was for a very early version  
of ruby 1.9, so YMMV. With any luck, just the static link change will  
get it working for you.

# configure.in:

# add these lines after AC\_FUNC\_GETPGRP, in place of AC\_FUNC\_SETPGRP:

dnl AC\_FUNC\_SETPGRP does not work if cross compiling  
dnl Instead, assume we will have a prototype for setpgrp if cross  
compiling.  
if test “$cross\_compiling” = no; then  
AC\_FUNC\_SETPGRP  
else  
AC\_CACHE\_CHECK([whether setpgrp takes no argument],  
ac\_cv\_func\_setpgrp\_void,  
[AC\_TRY\_COMPILE([  
#include \<unistd.h\>  
], [  
if (setpgrp(1,1) == -1)  
exit (0);  
else  
exit (1);  
], ac\_cv\_func\_setpgrp\_void=no, ac\_cv\_func\_setpgrp\_void=yes)])  
if test $ac\_cv\_func\_setpgrp\_void = yes; then  
AC\_DEFINE(SETPGRP\_VOID, 1)  
fi  
fi

# after patching:

autoreconf

---

<div class="post-metadata">

**Author:** ![randall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b38774/32.png) [@randall](https://www.ruby-forum.com/u/randall)\
**Post date:** [April 6, 2008, 7:26am UTC](https://www.ruby-forum.com/t/ruby-socket-support/133989/3 "2008-04-06T07:26:45Z")

</div>

> With any luck, just the static link change will  
> get it working for you.

Joel,

You were right on the money. thank you for your comprehensive reply.

regards,

Mike

---

<div class="post-metadata">

**Author:** ![randall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b38774/32.png) [@randall](https://www.ruby-forum.com/u/randall)\
**Post date:** [April 6, 2008, 8:49am UTC](https://www.ruby-forum.com/t/ruby-socket-support/133989/4 "2008-04-06T08:49:37Z")

</div>

Mike Rosset wrote:

> > With any luck, just the static link change will  
> > get it working for you.
> 
> Joel,
> 
> You were right on the money. thank you for your comprehensive reply.
> 
> regards,
> 
> Mike

Great! Mind if I ask which platform…?

---

<div class="post-metadata">

**Author:** ![randall](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b38774/32.png) [@randall](https://www.ruby-forum.com/u/randall)\
**Post date:** [April 6, 2008, 10:36am UTC](https://www.ruby-forum.com/t/ruby-socket-support/133989/5 "2008-04-06T10:36:22Z")

</div>

Joel VanderWerf wrote:

> Mike Rosset wrote:
> 
> > > With any luck, just the static link change will  
> > > get it working for you.
> > 
> > Joel,
> > 
> > You were right on the money. thank you for your comprehensive reply.
> > 
> > regards,
> > 
> > Mike
> 
> Great! Mind if I ask which platform…?

Oddly enough right now i386. you can find the project here  
[Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/uarch/) . hopefully I can find some arm hardware  
so I can start porting to arm.

Mike
