ocra ruby conversion to exe how to overcome required lib

447 views Asked by At

I am new to Ruby, and trying to find a solution to convert existing ruby scripts to exe executables. I choose OCRA to convert ruby script to executbales. I am unable to convert this files to executable. The ocra conversition throwing error , that unable to load required libraries. Thanks in advance.

===========================================

require 'selenium-webdriver'
require 'page-object'

class SubjectSearchPage < CommonElement
  include PageObject

  text_field(:ssnField, :id => "SSN")
  button(:searchBtn, :css => 'button[data-test-id="20180820140732083632904"]')
  h2(:resultsHeaderTitle, :css => 'div[data-test-id="201808231334560745670_header"] h2.header-title')
  elements(:resultRows, :css => '#bodyTbl_right > tbody > tr')
  span(:result, :css => 'span[data-test-id="2016072109335505834280"]')

end

=======================================================

c:\Users\seshaddri\git\pega-functional-tests\selenium-ruby\pages\subject_mgmt>ocra subject_search_page.rb --add-all-core
=== Loading script to check dependencies
C:/Bitnami/rubystack-2.3.8-1/ruby/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- selenium-webdriver (LoadError)
        from C:/Bitnami/rubystack-2.3.8-1/ruby/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from c:/Users/seshaddri/git/pega-functional-tests/selenium-ruby/pages/subject_mgmt/subject_search_page.rb:2:in `<top (required)>'
        from C:/Bitnami/rubystack-2.3.8-1/ruby/lib/ruby/gems/2.3.0/gems/ocra-1.3.10/bin/ocra:1211:in `load'
        from C:/Bitnami/rubystack-2.3.8-1/ruby/lib/ruby/gems/2.3.0/gems/ocra-1.3.10/bin/ocra:1211:in `<top (required)>'
        from C:/Bitnami/rubystack-2.3.8-1/ruby/bin/ocra:23:in `load'
        from C:/Bitnami/rubystack-2.3.8-1/ruby/bin/ocra:23:in `<main>'
1

There are 1 answers

2
Simon L. Brazell On BEST ANSWER

You just need to install the dependencies in your development environment and ocra will package them into the exe for you.

E.g. gem install selenium-webdriver

And then run the build again. Do this for all your projects dependencies.