rubyrubygemscalabashcalabash-android

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


I've successfully generated file tree via calabash-android gen

After that I've tried to run tests:

calabash-android run ../app/build/outputs/apk/app-debug.apk 

But got error:

Unable to activate calabash-android-0.9.0, because json-2.0.2 conflicts with json (~> 1.8) (Gem::ConflictError)

I've installed json 1.8.6 via gem install 'json' -v 1.8.6

and now gem list json outputs me

*** LOCAL GEMS ***

json (default: 2.0.2, 1.8.6)
multi_json (1.12.1)

But error Unable to activate calabash-android-0.9.0, because json-2.0.2 conflicts with json (~> 1.8) (Gem::ConflictError) throwed again. Where I am wrong?

UPD

I've tried to solve problem as described here github.com/calabash/calabash-ios/issues/1260 but osx says that I cant remove 2.0.2 version because it's default

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

Solution

  • Problem solved by using bundler

    bundle init
    

    Gemfile content replaced with

    # frozen_string_literal: true
    source "https://rubygems.org"
    
    gem 'calabash-android'
    

    then

    bundle install