Ruby socket support

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

···

--
Posted via http://www.ruby-forum.com/.

Mike Rosset wrote:

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

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

# after patching:
autoreconf

···

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

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

···

--
Posted via http://www.ruby-forum.com/\.

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

···

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

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. . hopefully I can find some arm hardware
so I can start porting to arm.

Mike

···

--
Posted via http://www.ruby-forum.com/\.