[英]Calabash-Android on Windows
我不確定最近是否已經討論過這個話題,但我對自己在網上搜索感到非常沮喪,嘗試了幾個指南和修復程序。 我做了很多事情,我無法真正說出我已經做了什么:(
所以我試圖在 Windows 10 64 位上運行 Calabash-Android,我按照https://github.com/calabash/calabash-android上的步驟,我安裝了 ruby、Ant 和 DevKit。 當我現在嘗試運行測試時:
calabash-android run app-release.apk
我得到這樣的輸出:
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
WARNING: cannot load such file -- gherkin_lexer_en
Couldn't load gherkin_lexer_en
The $LOAD_PATH was:
lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/bin/../lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/builder-3.2.2/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/diff-lcs-1.2.5/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/multi_json-1.11.2/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/multi_test-0.1.2/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/retriable-1.4.1/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/slowhandcuke-0.0.3/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/rubyzip-1.1.7/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/awesome_print-1.6.1/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/httpclient-2.7.0.1/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/escape-0.0.4/lib
C:/Ruby21/lib/ruby/gems/2.1.0/gems/calabash-android-0.5.14/lib
C:/Ruby21/lib/ruby/site_ruby/2.1.0
C:/Ruby21/lib/ruby/site_ruby/2.1.0/i386-msvcrt
C:/Ruby21/lib/ruby/site_ruby
C:/Ruby21/lib/ruby/vendor_ruby/2.1.0
C:/Ruby21/lib/ruby/vendor_ruby/2.1.0/i386-msvcrt
C:/Ruby21/lib/ruby/vendor_ruby
C:/Ruby21/lib/ruby/2.1.0
C:/Ruby21/lib/ruby/2.1.0/i386-mingw32. Reverting to Ruby lexer.
No lexer was found for en (cannot load such file -- gherkin/lexer/en). Supported languages are listed in gherkin/i18n.json. (Gherkin::I18n::LexerNotFound)
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/i18n.rb:108:in `rescue in lexer'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/i18n.rb:97:in `lexer'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser/parser.rb:139:in `transition_table'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser/parser.rb:128:in `build_transition_map'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser/parser.rb:124:in `transition_map'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser/parser.rb:91:in `initialize'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser/parser.rb:68:in `new'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser/parser.rb:68:in `push_machine'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2-x86-mingw32/lib/gherkin/parser/parser.rb:31:in `parse'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/lib/cucumber/feature_file.rb:37:in `parse'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/lib/cucumber/runtime/features_loader.rb:28:in `block in load'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/lib/cucumber/runtime/features_loader.rb:26:in `each'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/lib/cucumber/runtime/features_loader.rb:26:in `load'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/lib/cucumber/runtime/features_loader.rb:14:in `features'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/lib/cucumber/runtime.rb:179:in `features'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/lib/cucumber/runtime.rb:49:in `run!'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/lib/cucumber/cli/main.rb:47:in `execute!'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/cucumber-1.3.20/bin/cucumber:13:in `<top (required)>'
C:/Ruby21/bin/cucumber:23:in `load'
C:/Ruby21/bin/cucumber:23:in `<main>'
所以我在谷歌上搜索了第一個錯誤“警告無法加載此類文件[...],找到了多個結果,嘗試了這個https://github.com/cucumber/gherkin/issues/320 ,嘗試過:
gem install gherkin --platform=ruby
得到這樣的輸出:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing gherkin:
ERROR: Failed to build gem native extension.
C:/Ruby21/bin/ruby.exe extconf.rb
checking for main() in -lc... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby21/bin/ruby
--with-gherkin_lexer_ar-dir
--without-gherkin_lexer_ar-dir
--with-gherkin_lexer_ar-include
--without-gherkin_lexer_ar-include=${gherkin_lexer_ar-dir}/include
--with-gherkin_lexer_ar-lib
--without-gherkin_lexer_ar-lib=${gherkin_lexer_ar-dir}/lib
--with-clib
--without-clib
C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:556:in `try_link'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:736:in `try_func'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:967:in `block in have_library'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:912:in `block in checking_for'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:911:in `checking_for'
from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:962:in `have_library'
from extconf.rb:5:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/gherkin-2.12.2 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/gherkin-2.12.2/gem_make.out
我很確定我做了幾個修復,但對我沒有用,也許你們可以幫助我? 真的需要讓這個工作。 也許我只是錯過了一些小細節?
問候卡帕斯科
我們正在開發適用於 Windows 的實驗性 Calabash 沙箱,這可能會有所幫助。
在管理 Powershell 中,運行:
set-executionpolicy unrestricted
然后
(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/calabash/install/master/install-windows.ps1") | powershell -command -
然后打開命令提示符(不是powershell)並運行
calabash-sandbox
在該沙箱內,所有 calabash-android 命令都應該可以工作,並且您將擁有一個預配置的 ruby 環境(它不會影響系統的其余 ruby 配置)。
要退出沙箱,只需輸入exit
完成安裝后,請記住在 powershell 中運行它:
set-executionpolicy restricted
只是為了安全:)
我遇到了同樣的錯誤,我相信這是由於不匹配的依賴關系。 當我嘗試使用 Bundler 安裝所需的 gem 時,問題解決了。
Bundler 可以幫助您使用 gemfile 輕松管理所有依賴項。
試試這個 ==> bundler.io/#getting-started
對於每個想知道的人,我通過刪除所有組件並重新安裝它們來解決這個問題。 我無法解釋為什么它現在有效,但確實如此。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.