如何在 OS X 上启动 calabash-android? (Ruby 宝石依赖错误)

How to launch calabash-android on OS X? (Ruby gems dependency error)

我已经通过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

现在gem列表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

Gemfile 内容替换为

# 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