我已经通过calabash-android gen
成功生成了文件树
之后,我尝试运行测试:
calabash-android run ../app/build/outputs/apk/app-debug.apk
但是得到错误:
Unable to activate calabash-android-0.9.0, because json-2.0.2 conflicts with json (~> 1.8) (Gem::ConflictError)
我已经通过gem install 'json' -v 1.8.6
安装了 json 1.8.6
现在宝石列表 JSON 输出我
*** LOCAL GEMS ***
json (default: 2.0.2, 1.8.6)
multi_json (1.12.1)
但错误Unable to activate calabash-android-0.9.0, because json-2.0.2 conflicts with json (~> 1.8) (Gem::ConflictError)
再次抛出。我错在哪里?
UPD
我试图解决这里描述的问题 github.com/calabash/calabash-ios/issues/1260 但是osx说我无法删除2.0.2版本,因为它是默认的
MacBook-Pro-MacBook:calabash zub3r$ gem uninstall -Vax --force --no-abort-on-dependent json
ERROR: While executing gem ... (Gem::InstallError)
json is not installed in GEM_HOME, try:
gem uninstall -i /Users/zub3r/.rvm/gems/ruby-2.4.0@global json
MacBook-Pro-MacBook:calabash zub3r$ gem uninstall -i /Users/zub3r/.rvm/gems/ruby-2.4.0@global json
You have requested to uninstall the gem:
json-1.8.6
calabash-android-0.9.0 depends on json (~> 1.8)
cucumber-1.3.20 depends on json (~> 1.7, development)
luffa-2.0.0 depends on json (~> 1.8)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] ^CERROR: Interrupted
MacBook-Pro-MacBook:calabash zub3r$ gem uninstall -i /Users/zub3r/.rvm/gems/ruby-2.4.0@global json --version 2.0.2
ERROR: While executing gem ... (Gem::InstallError)
gem "json" cannot be uninstalled because it is a default gem
使用 bundler
解决了问题
bundle init
宝石文件内容替换为
# frozen_string_literal: true
source "https://rubygems.org"
gem 'calabash-android'
然后
bundle install
我遇到了同样的问题,我已经降级了我的 ruby 版本并解决了。请在下面找到解决方案
$ gem -v
2.0.3
$ gem list rubygems-update
$ gem uninstall -v 2.0.3 rubygems-update
$ gem install -v 1.8.24 rubygems-update
$ update_rubygems
$ gem -v
1.8.24