18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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
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!!!
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
gem install Platform
and check?
That dependency should have automatically been picked by Sahi. Not sure why it did not.
Regards,
narayan
#!/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.
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)
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