Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gem::ConflictError #905

Open
sudarshan-narayanan-we45 opened this issue Dec 12, 2018 · 13 comments
Open

Gem::ConflictError #905

sudarshan-narayanan-we45 opened this issue Dec 12, 2018 · 13 comments

Comments

@sudarshan-narayanan-we45

While trying to run calabash-android against a target app, I am facing the following error.

$ calabash-android run my-calculator.apk
Unable to activate luffa-2.0.0, because json-2.1.0 conflicts with json (~> 1.8) (Gem::ConflictError)
/Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems/specification.rb:2304:in raise_if_conflicts' /Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems/specification.rb:1420:in activate'
/Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems/specification.rb:1454:in block in activate_dependencies' /Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems/specification.rb:1440:in each'
/Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems/specification.rb:1440:in activate_dependencies' /Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems/specification.rb:1422:in activate'
/Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems.rb:223:in rescue in try_activate' /Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems.rb:216:in try_activate'
/Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:123:in rescue in require' /Users/sudarshannarayanan/.rvm/rubies/ruby-head/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in require'
/Users/sudarshannarayanan/Projects/CalabashDemo/features/support/env.rb:1:in <top (required)>' /Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/lib/cucumber/glue/registry_and_more.rb:107:in load'
/Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/lib/cucumber/glue/registry_and_more.rb:107:in load_code_file' /Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/lib/cucumber/runtime/support_code.rb:144:in load_file'
/Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/lib/cucumber/runtime/support_code.rb:85:in block in load_files!' /Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/lib/cucumber/runtime/support_code.rb:84:in each'
/Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/lib/cucumber/runtime/support_code.rb:84:in load_files!' /Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/lib/cucumber/runtime.rb:272:in load_step_definitions'
/Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/lib/cucumber/runtime.rb:68:in run!' /Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/lib/cucumber/cli/main.rb:34:in execute!'
/Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/gems/cucumber-3.1.2/bin/cucumber:9:in <top (required)>' /Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/bin/cucumber:23:in load'
/Users/sudarshannarayanan/.rvm/gems/ruby-head@calabash/bin/cucumber:23:in `

'

Here is my gemlist.

$ gem list

*** LOCAL GEMS ***

awesome_print (1.8.0)
backports (3.11.4)
bigdecimal (default: 1.3.4)
builder (3.2.3)
bundler (default: 2.0.0.pre.2, 1.17.1)
calabash-android (0.9.8)
calabash-cucumber (0.21.8)
clipboard (1.1.2)
cmath (default: 1.0.0)
command_runner_ng (0.1.4)
concurrent-ruby (1.1.3)
csv (default: 3.0.1)
cucumber (3.1.2)
cucumber-core (3.2.1)
cucumber-expressions (6.0.1)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
date (default: 1.0.0)
dbm (default: 1.0.0)
diff-lcs (1.3)
e2mmap (default: 0.1.0)
edn (1.1.1)
escape (0.0.4)
etc (default: 1.0.1)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.1.0)
forwardable (default: 1.2.0)
gdbm (default: 2.0.0)
geocoder (1.5.0)
gherkin (5.1.0)
httpclient (2.8.3)
i18n (0.9.5)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
irb (default: 0.9.6)
json (default: 2.1.0, 1.8.6)
logger (default: 1.2.7)
luffa (2.0.0)
matrix (default: 0.1.0)
multi_json (1.13.1)
multi_test (0.1.2)
mutex_m (default: 0.1.0)
openssl (default: 2.1.2)
ostruct (default: 0.1.0)
prime (default: 0.1.0)
psych (default: 3.1.0.pre2)
rdoc (default: 6.1.0.beta2)
retriable (2.0.2)
rexml (default: 3.1.7.3)
rss (default: 0.2.7)
rubyzip (1.2.2)
run_loop (4.1.0)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
shell (default: 0.7)
slowhandcuke (0.0.3)
stringio (default: 0.0.2)
strscan (default: 1.0.0)
sync (default: 0.1.0)
thor (0.20.3)
thwait (default: 0.1.0)
tracer (default: 0.1.0)
webrick (default: 1.4.2)
zlib (default: 1.0.0)

I would like to know how to resolve the json conflict and execute the Gherkin script.

@schnapzz
Copy link

I've had luck removing the json 2.1.0 dependency in the past and only have json 1.8.6 installed. This clears up most of my issues with Calabash and i don't have anything else depending on json 2.1.0 anyway.
Don't know if this is still relevant.

@antuking
Copy link

antuking commented Apr 2, 2019

The same issue and still don't resolve this one yet.
@schnapzz How to downgrade the json to 1.8.6?

@jmoody
Copy link
Contributor

jmoody commented Apr 2, 2019

Let's remove the json version dependency all together.

The gemspec should contain "json" with no version.

@schnapzz
Copy link

schnapzz commented Apr 2, 2019

@antuking i removed all other json gems, so the only one i had installed was json 1.8.6. Luckily i had no other gems depending on newer versions of the json gem.
@jmoody Will this be added to the next version of calabash?

@antuking
Copy link

antuking commented Apr 2, 2019

I still receive the error after uninstall all of json versions and only install 1.8.6.

Unable to activate luffa-2.0.0, because json-2.1.0 conflicts with json (~> 1.8) (Gem::ConflictError)

And here is my Gem file
ISSUE

@schnapzz What is it wrong here? (Ruby 2.6.1, Rubyzip 1.2.1, calabash-android 0.9.5)

@schnapzz
Copy link

schnapzz commented Apr 2, 2019

@antuking It would seem that you still have json 2.1.0 installed as a gem. If you do a gem list, do you have both multiple json gems installed?

@antuking
Copy link

antuking commented Apr 2, 2019

Right @schnapzz , i tried to remove 2.1.0 but didn’t affect. Besides, i set 1.8.6 is default version.
json (default: 2.1.0, default: 1.8.6)

I used both cmd for this one

gem uninstall json:2.1.0
gem uninstall json -v "2.1.0"

@jmoody
Copy link
Contributor

jmoody commented Apr 3, 2019

@antuking

Yeah, that is not good.

Here is what I recommend: remove the Luffa dependency. That gem is used for its Version class.

Copy the version class from run-loop and add it (properly name spaced) to this gem.

https://github.com/calabash/run_loop/blob/develop/lib/run_loop/version.rb

Is that something you can do?

@jmoody
Copy link
Contributor

jmoody commented Apr 3, 2019

@antuking

I am in the process of releasing luffa 2.1.0; it will not have a dependency on specific json or bundler version. It would be good to remove the Luffa::Version code from this gem.

@antuking
Copy link

antuking commented Apr 3, 2019

Thanks @jmoody , i'll try when luffa release with ver2.1.0. Btw, i'm working around with your suggest.

@jmoody
Copy link
Contributor

jmoody commented Apr 3, 2019

luffa 2.1.0 released.

@antuking
Copy link

antuking commented Apr 3, 2019

I upgraded the luffa and force remove the json default in gems. That's great. Many thanks @jmoody

@jmoody
Copy link
Contributor

jmoody commented Apr 3, 2019

To remove gems:

$ gem update --system
$ gem uninstall -Vax --force --no-abort-on-dependent <gem name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants