gpt4 book ai didi

android - Appium:Ruby: 在 gem 中加载错误

转载 作者:太空宇宙 更新时间:2023-11-03 16:16:24 26 4
gpt4 key购买 nike

加载此 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>'

最佳答案

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

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

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

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

require 'appium_lib/adbManager'

关于android - Appium:Ruby: 在 gem 中加载错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43487784/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com