18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Running Ruby scripts on Linux

gvastgvast Members
edited June 2010 in Sahi - Open Source
Hi all

I was running successfully test ruby scripts with sahi on Windows. But I'm trying to run them on ubuntu linux 10.04 and my scripts don't find "sahi" package at require sentence. Anyone can help me?
Thanks!


Now, I'm trying the following script (only for test if found "sahi" package):

#!/usr/bin/ruby
require 'test/unit'
require "sahi"

class StringTest < Test::Unit::TestCase

def test_length
s = "Hello, World!"
assert_equal(13, s.length)
end

end

And now the error is:

/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- Platform (LoadError)
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/lib/gems/1.8/gems/sahi-1.0.1/lib/sahi.rb:4
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
from ./mytest.rb:3

I don't know what is the problem. If someone know the answer, thanks!!!

Comments

  • narayannarayan Administrators
    Could you do a
    gem install Platform
    and check?

    That dependency should have automatically been picked by Sahi. Not sure why it did not.

    Regards,
    narayan
  • gvastgvast Members
    Yes, I have Platform (0.4.0) installed, and the problem continues. All other ruby packages (gems) works without problem. I tryed in two machines with the same ubuntu version (10.04), maybe is a problem with that distribution. Thanks again
  • narayannarayan Administrators
    Let me get you something that can run on Ubuntu without the Platform dependency.
  • gvastgvast Members
    edited July 2010
    The code below works well without "requiere 'sahi'" line:

    #!/usr/bin/ruby
    require 'test/unit'

    class StringTest < Test::Unit::TestCase

    def test_length
    s = "Hello, World!"
    assert_equal(13, s.length)
    end

    end

    PS: Only with watir I had to add "require 'rubygems'", but this didn't work with Sahi

    This code use test-unit gem and doesn't show any error message.
  • sdqalisdqali Members
    edited August 2010
    I was looking at the code for the Ruby bindings.
    I can see that in sahi.rb, you are requiring the Platform gem as:

    require 'Platform'

    But the Platform gem needs to be required as:

    require 'platform'

    I tried changing this in the file and it solved this particular issue on my Linux box.


    I have other issues getting the Ruby bindings to work, but those are part of other thread(s)
  • narayannarayan Administrators
    Hi sdqali,

    Thanks for the response. Will change it in the codebase. keep us posted on other bugs. We do not have many Ruby users who participate in the forums. Thanks for your help.

    Regards,
    Narayan
Sign In or Register to comment.