Gem compilation failing on AIX 64 bit box

I'm trying to compile ruby 64 bit on aix 64 bit box.
I configured ruby by enabling libpthread. and compiled the same.
But when i try to run ruby setup.rb, i get the following error:

/home/xyz/RUBY_64/lib/ruby/1.8/ load failed -
/lib/ruby/1.8/ (LoadError)
        from /home/xyz/RUBY_64/lib/ruby/1.8/thread.rb:5
        from /home/xyz/RUBY_64/lib/ruby/site_ruby/1.8/rubygems.rb:85:in
        from /home/xyz/RUBY_64/lib/ruby/site_ruby/1.8/rubygems.rb:85
        from setup.rb:1526:in `exec_task_traverse'
        from setup.rb:1342:in `exec_install'
        from setup.rb:1000:in `exec_install'
        from setup.rb:814:in `invoke'
        from setup.rb:773:in `invoke'
        from setup.rb:1578

I've tried the same with ruby -d option and it does not give any more
Also, ldd on does not show any dependencies!

any idea?