Welcome to Samsara
   

Huh? What?
An E-playground for members of Bebear.net

Subscribe
Receive the RSS Feed of Samsara updates.

Links
People's pages that live on this server

  • Al Hoang
  • Al Crockett
  • Citizens For a Clean Environment
  • Andy Chen
  • Dave Phillips
  • Peter Tanski
  • Dan
  • Jon Constant
  • Kiwa Sasaki
  • A Musing Fool
  • Paul Lavoie
  • Ken Watanabe
  • Stephen Young

  • Blosxom powered
    Served on Apache
    Powered by FreeBSD
    Powered by djbdns

           
    Fri, 10 Nov 2006

    Jruby doesn't support fork()


    I noticed Charles Nutter (one of the JRuby developers) mentioning that the fork() method in JRuby will most not likely be supported:

    We would strongly prefer to avoid any implementation that requires fork, since we can't really support fork in JRuby.

    While I can understand the difficulties in the Java VM giving lots of hell trying to handle something like fork() I feel it's a shame since it means if you use fork and quite a few process related calls in Ruby it will not be portable in JRuby. For a sysadmin, handling processes is one of their jobs so personally, I hope they can come up with some way to handle it somehow. But JRuby's strengths might not be in a scripting language for sys admins but providing a way to integrate rails with the monster that is J2EE. How cool would it be to develop a rails application all in the context of a java web application that you can just deploy right into a Java application server? I think this could be JRuby's little nitch (besides being an integration tool for java devs)

    More here

    [/al/ruby] permanent link

    Fri, 27 Oct 2006

    Fixing 'mkmf' load error Ruby in Ubuntu


    If you're a Debian or Ubuntu user you'll find that the Ruby standard distribution is split into lots of little packages so doing something like apt-get install ruby only gives you the ruby binary and a subset of the libraries for Ruby. You'll need to add more packages if you want to utilize more of Ruby's standard library. This is all in order to comply with Debian packaging Guidelines. That is all well and good but a little frustrating when you 'just want to do work'.

    For example, I wanted to install sys-proctable (Something I really believe should be in Ruby's standard distribution) however ran into the following:
    $ sudo gem install sys-proctable
    Building native extensions. This could take a while...
    extconf.rb:8:in `require': no such file to load -- mkmf (LoadError)
        from extconf.rb:8

    ERROR: While executing gem ... (RuntimeError)
       ERROR: Failed to build gem native extension.
    Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sys-proctable-0.7.3 for inspection.

    To get around this you will need to install ruby1.8-dev (or ruby1.6-dev or whatever version of ruby you're running) to get mkmf.rb which is listed in the Ruby Standard Library. I'm sure most Ruby hackers worth their salt consider this a 'duh' thing but not of all of us can be shining stars in the Ruby community

    How I fixed it...
    $ sudo apt-get install ruby1.8-dev
    ..
    $ sudo gem install sys-proctable
    Need to update 4 gems from http://gems.rubyforge.org
    ....
    complete
    Building native extensions. This could take a while...
    ruby extconf.rb install sys-proctable
    checking for rb_pid_t... yes
    creating Makefile

    make
    gcc -fPIC -Wall -g -O2 -fPIC -I. -I/usr/lib/ruby/1.8/i486-linux -I/usr/lib/ruby/1.8/i486-linux -I. -DHAVE_TYPE_RB_PID_T -c proctable.c
    gcc -shared -L"/usr/lib" -o proctable.so proctable.o -lruby1.8 -lpthread -ldl -lcrypt -lm -lc

    make install
    mkdir -p /usr/lib/ruby/gems/1.8/gems/sys-proctable-0.7.3/lib/sys
    /usr/bin/install -c -m 0755 proctable.so /usr/lib/ruby/gems/1.8/gems/sys-proctable-0.7.3/lib/sys

    make clean
    Successfully installed sys-proctable-0.7.3
    Installing ri documentation for sys-proctable-0.7.3...
    Installing RDoc documentation for sys-proctable-0.7.3...

    [/al/ruby] permanent link

    Sun, 13 Aug 2006

    Bruce Eckel takes another look at Ruby


    Bruce Eckel of Thinking in Java fame takes a second look at Ruby. This time he has far less harsh words than his previous look at it (Note that the original post that Eckel made on Ruby seems to be MIA on his website. I'm a little miffed at that...)

    His second time around he seems a little more impressed but I have to agree with some readers who pointed out that if he bothered to read the Pickaxe book he would have found a good portion of these features in Ruby. Although for a counterpoint, I've tried reading some comparisons of Python and Ruby and most of them end up in a 'mine is bigger' argument rather than try to really see what is different. Mr. Eckel has spent some time summarizing the differences. The reason it's easier to believe him is because he is staunch follower of Python.

    Read his second look yourself

    [/al/ruby] permanent link

    Tue, 17 Jan 2006

    Windows-based Ruby install with Rubygems interfering with cygwin ruby?


    I had a problem with a windows-based install of Ruby with RubyGems kept screwing up my cygwin-based installation of Ruby. Seems this is a 'well-known' problem in the Ruby community. The symptons look like this

    $ irb
    /usr/bin/ruby: no such file to load -- ubygems (LoadError)

    Really annoying. To fix this unset the RUBYOPT environment variable in your cygwin shell's setting. The manual way to do this in bash is shown:

    $ unset RUBYOPT
    $ irb
    irb(main):001:0>

    [/al/ruby] permanent link