ruby socket support

M

Mike Rosset

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
 
J

Joel VanderWerf

Mike said:
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
fi

# after patching:
autoreconf
 
M

Mike Rosset

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,289
Messages
2,571,448
Members
48,126
Latest member
ToneyChun2

Latest Threads

Top