Appium:Ruby:在gem中加载错误

时间:2017-04-19 06:14:22

标签: android ruby adb appium

我在加载此require-relative元素时遇到错误。任何想法如何解决?

我已经尝试搜索android sdk,对于require relative中提到的以下内容,是否有任何文件我应该放置以使其工作?>

require 'appium_lib'
require_relative './libs/adbManager'
require_relative './libs/error_handler'
require_relative './libs/android_manifest_parser'

错误:

cannot load such file -- /Users/jain/Documents/fslearning-android/Features/Support/libs/adbManager (LoadError)
/Users/jain/Documents/fslearning-android/Features/Support/hooks.rb:2:in `require_relative'
/Users/jain/Documents/fslearning-android/Features/Support/hooks.rb:2:in `<top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:in `load'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:in `load_code_file'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:142:in `load_file'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:84:in `block in load_files!'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:in `load_files!'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:253:in `load_step_definitions'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:61:in `run!'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/cli/main.rb:32:in `execute!'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/bin/cucumber:8:in `<top (required)>'
/usr/local/bin/cucumber:22:in `load'
/usr/local/bin/cucumber:22:in `<main>'

1 个答案:

答案 0 :(得分:1)

您向我寻求帮助,但除了您最初发布的错误之外,我可以给您一些一般性的建议,因为我没有appium本身的经验且先决条件太高而无法尝试。

您从哪里获得了您正在制作的require_relative的代码? 我在网上找不到太多文档。他们应该参考宝石或红宝石文件。 对于gem(如require 'appium_lib'),您需要满足先决条件(仅限iOs?,gem安装?等),如果是ruby脚本文件,您可以检查文件在文件系统中的位置和你最好使用fileextension .rb

例如require_relative './libs/adbManager.rb' 将是一个位于主脚本的子文件夹库中的文件,名为adbManager.rb

如果它是appium的一部分,那就更像是

require 'appium_lib/adbManager'