0

我是 Ruby 新手,并试图找到将现有 ruby​​ 脚本转换为 exe 可执行文件的解决方案。我选择 OCRA 将 ruby​​ 脚本转换为可执行文件。我无法将此文件转换为可执行文件。ocra 转换抛出错误,即无法加载所需的库。提前致谢。

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

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>'
4

1 回答 1

0

您只需要在您的开发环境中安装依赖项,ocra 就会为您将它们打包到 exe 中。

例如 gem install selenium-webdriver

然后再次运行构建。对所有项目依赖项执行此操作。

于 2019-02-25T21:21:43.013 回答