奥克拉红宝石转换为exe如何克服所需的lib

时间:2019-02-25 19:14:01

标签: ruby-on-rails ruby selenium ocra

我是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>'

1 个答案:

答案 0 :(得分:0)

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

例如gem install selenium-webdriver

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