Building ruby

Discussion in 'Ruby' started by Jon Rust, Apr 9, 2008.

  1. Jon Rust

    Jon Rust Guest

    The linux systems I admin @ work have an old version of ruby (1.8.2).
    I've decided to attempt an upgrade. (SuSE 9.1 fwiw.)

    First attempt was with Ruby 1.9.0-1. Everything seemed to work fine,
    even got a recent build of OCI8 to work, and my oracle connection
    scripts were golden. Then I tried another group of scripts with less
    favorable results. Apparently 'ping' isn't in the std lib anymore? It
    wasn't immediately clear to me that net-ping-1.22 would be a drop in
    replacement, so I punted on 1.9. :-(

    Next in line was 1.8.6-p114. Also went smoothly through build. Tried to
    run a few scripts... nope. Error on 'socket'? huh?

    irb(main):001:0> require 'socket'
    LoadError: no such file to load -- socket
    from (irb):1:in `require'
    from (irb):1

    I see in the console from 'make' that socket was built cleanly. And it's
    in the lib directory:

    lib/ruby/1.8/i686-linux/socket.so

    Been using ruby for some time now and feel like a noobie all of a sudden
    by not being able to get either of these builds working. Both builds
    were done with "./configure; make; sudo make install". Nothing special.

    Any tips welcome. My scripts are monitoring oriented, making liberal use
    of ping, socket, OCI8, gserve, thread and timeout. (If any of that makes
    a difference.)

    thanks,
    jon
    --
    Posted via http://www.ruby-forum.com/.
    Jon Rust, Apr 9, 2008
    #1
    1. Advertising

  2. Jon Rust

    Marc Heiler Guest

    > The linux systems I admin @ work have an old version of ruby (1.8.2).
    > I've decided to attempt an upgrade. (SuSE 9.1 fwiw.)
    >
    > First attempt was with Ruby 1.9.0-1.



    You should be careful from 1.8 to 1.9
    As far as I understood it, 1.9 is a "different language" than 1.8

    > Everything seemed to work fine


    Famous last words SCNR ;-)

    > Next in line was 1.8.6-p114. Also went smoothly through build. Tried to
    > run a few scripts... nope. Error on 'socket'? huh?
    >
    > irb(main):001:0> require 'socket'
    > LoadError: no such file to load -- socket



    Works here.
    My ruby is source built from p114:
    ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]

    Maybe you have messed up your ruby install. Or the default SuSE
    ruby is missing some bits. Personally I compile things into
    self-contained dirs.

    > Both builds were done with "./configure; make; sudo make install". Nothing special.


    Guess that will default to /usr/local
    Where does your irb reside at? And do you have /usr/lib/ruby*
    something, some stray ruby files somewhere?

    All I know is that it *should* work (it works here)
    --
    Posted via http://www.ruby-forum.com/.
    Marc Heiler, Apr 9, 2008
    #2
    1. Advertising

  3. On Apr 9, 1:25 am, Jon Rust <> wrote:
    >irb(main):001:0> require 'socket'
    > LoadError: no such file to load -- socket
    >         from (irb):1:in `require'
    >         from (irb):1
    >
    > I see in the console from 'make' that socket was built cleanly. And it's
    > in the lib directory:
    >
    >   lib/ruby/1.8/i686-linux/socket.so
    >


    It may be a path issue. "strace" in a shell is your friend. Run
    "strace ruby yourscript.rb 2>&1 | grep socket | more". It'll how you
    what files/directories your new Ruby interpreter actually tries
    loading the socket extension from. (strace shows you what system calls
    your app calls - it's very flexible, and well worth learning how to
    use)

    Vidar
    Vidar Hokstad, Apr 9, 2008
    #3
  4. Jon Rust

    Jon Rust Guest

    Vidar Hokstad wrote:
    > It may be a path issue. "strace" in a shell is your friend. Run
    > "strace ruby yourscript.rb 2>&1 | grep socket | more". It'll how you


    Glorious. Thanks for the tip/reminder. (slapping forehead)

    The socket.so file was installed mode 640. Doh!

    stat64("/usr/local/ruby186/lib/ruby/1.8/i686-linux/socket.so",
    {st_mode=S_IFREG|0750, st_size=84340, ...}) = 0

    open("/usr/local/ruby186/lib/ruby/1.8/i686-linux/socket.so",
    O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission denied)


    Thanks,
    jon

    --
    Posted via http://www.ruby-forum.com/.
    Jon Rust, Apr 10, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Midex
    Replies:
    24
    Views:
    876
  2. Gavin Sinclair

    Building Ruby 1.8 preview 3

    Gavin Sinclair, Jul 9, 2003, in forum: Ruby
    Replies:
    5
    Views:
    130
    Ariff Abdullah
    Jul 13, 2003
  3. Alexey Verkhovsky
    Replies:
    0
    Views:
    163
    Alexey Verkhovsky
    Jan 20, 2005
  4. Hugh Sasse

    Ruby Quiz for building up Ruby?

    Hugh Sasse, Oct 27, 2005, in forum: Ruby
    Replies:
    13
    Views:
    198
    swille
    Oct 29, 2005
  5. anne001
    Replies:
    1
    Views:
    396
Loading...

Share This Page