xcpretty / xcode-install

๐Ÿ”ฝ Install and update your Xcodes
https://fastlane.tools
MIT License
2.58k stars 237 forks source link

Gem conflict error with CLAide #452

Closed triplef closed 2 years ago

triplef commented 2 years ago

With some recent update to Fastlane and/or its dependencies Iโ€™m getting the following error:

Unable to activate xcode-install-2.6.6, because claide-1.1.0 conflicts with claide (>= 0.9.1, < 1.1.0) (Gem::ConflictError)

If I understand it correctly this is because some other Gem with a dependency on CLAide caused claide-1.1.0 to be installed, but xcode-install requires a version < 1.1.0:

https://github.com/xcpretty/xcode-install/blob/17b5e91c46c0c8d27619e29ac215caf7d8211341/xcode-install.gemspec#L25

Is there any reason for this restriction, or can anyone recommend how to resolve this?

The CLAide releases on GitHub donโ€™t yet show version 1.1.0, but the changes from the last pre-1.1.0 version seem relatively small: https://github.com/CocoaPods/CLAide/compare/1.0.3...master

rogerluan commented 2 years ago

Hey @triplef ๐Ÿ‘‹

I just checked here and none of fastlane's dependencies seem to require claide 1.1.0, and I was able to install xcode-install without issues (v2.8.0 though, not your specific v2.6.6). Although this shouldn't be the case but have you tried upgrading xcode-install?

Check if you have other dependencies locally other than fastlane that could be causing these issues. Try bundle clean also to get rid of unused gems, which might help with your issue if it's a cache problem.

Let me know your findings ๐Ÿ™

kikeenrique commented 2 years ago

I'm also reproducing this problem. I've fastlane installed from brew.

$ fastlane run xcversion

[โœ”] ๐Ÿš€
[14:13:54]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[14:13:55]: It seems like you wanted to load some plugins, however they couldn't be loaded
[14:13:55]: Please follow the troubleshooting guide: https://docs.fastlane.tools/plugins/plugins-troubleshooting/
[14:13:55]: -----------------------
[14:13:55]: --- Step: xcversion ---
[14:13:55]: -----------------------
[14:13:55]: To not be asked about this value, you can specify it using 'version'
[14:13:55]: The version of Xcode to select specified as a Gem::Version requirement string (e.g. '~> 7.1.0'): 13.2.1
/usr/local/Cellar/ruby/3.0.3/lib/ruby/3.0.0/rubygems/specification.rb:2237:in `raise_if_conflicts': Unable to activate xcode-install-2.8.0, because claide-1.1.0 conflicts with claide (>= 0.9.1, < 1.1.0) (Gem::ConflictError)
    from /usr/local/Cellar/ruby/3.0.3/lib/ruby/3.0.0/rubygems/specification.rb:1368:in `activate'
    from /usr/local/Cellar/ruby/3.0.3/lib/ruby/3.0.0/rubygems.rb:221:in `rescue in try_activate'
    from /usr/local/Cellar/ruby/3.0.3/lib/ruby/3.0.0/rubygems.rb:214:in `try_activate'
...

Do you have any idea what could be the problem? where or why is it trying to install xcode-install? If I check with gem list I can see it installed

$gem list
...
 xcode-install (2.8.0)
...
rogerluan commented 2 years ago

Thanks for the input @kikeenrique ! @triplef are you also installing fastlane using brew?

In general only Bundler is the recommended way to install fastlane and any other RubyGem dependencies ๐Ÿ˜ฌ

Try cleaning up unused/old gems in your machine:

gem cleanup --dryrun # Will let you know what would be cleaned up, without removing anything
gem cleanup # Will clean up unused/old gems
kikeenrique commented 2 years ago

Indeed, I think it could be a problem with brew fastlane package. There are two claide versions installed and xcode-install.gemspec is restricted to '>= 0.9.1', '< 1.1.0'

 ls -la /usr/local/Cellar/fastlane/2.204.2/libexec/gems/

total 0
drwxr-xr-x  94 kikeenrique  admin  3008 Feb  4 16:32 .
drwxr-xr-x  10 kikeenrique  admin   320 Feb  4 02:05 ..
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 CFPropertyList-3.0.5
drwxr-xr-x  12 kikeenrique  admin   384 Feb  4 02:05 addressable-2.8.0
drwxr-xr-x   4 kikeenrique  admin   128 Feb  4 02:05 artifactory-3.0.15
drwxr-xr-x  17 kikeenrique  admin   544 Feb  4 02:05 atomos-0.1.3
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 aws-eventstream-1.2.0
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 aws-partitions-1.552.0
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 aws-sdk-core-3.126.0
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 aws-sdk-kms-1.54.0
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 aws-sdk-s3-1.112.0
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 aws-sigv4-1.4.0
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 babosa-1.0.4
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 13:32 badge-0.13.0
drwxr-xr-x@ 17 kikeenrique  admin   544 Feb  4 13:32 claide-1.0.3
drwxr-xr-x@ 17 kikeenrique  admin   544 Feb  4 02:05 claide-1.1.0
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 colored-1.2
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 colored2-3.1.2
drwxr-xr-x  18 kikeenrique  admin   576 Feb  4 02:05 commander-4.6.0
drwxr-xr-x  11 kikeenrique  admin   352 Feb  4 02:05 declarative-0.0.20
drwxr-xr-x  17 kikeenrique  admin   544 Feb  4 02:05 digest-crc-0.6.4
drwxr-xr-x  15 kikeenrique  admin   480 Feb  4 02:05 domain_name-0.5.20190701
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 dotenv-2.7.6
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 emoji_regex-3.2.3
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 excon-0.91.0
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 faraday-1.9.3
drwxr-xr-x  11 kikeenrique  admin   352 Feb  4 02:05 faraday-cookie_jar-0.0.7
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 faraday-em_http-1.0.0
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 faraday-em_synchrony-1.0.0
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 faraday-excon-1.1.0
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 faraday-httpclient-1.0.1
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 faraday-multipart-1.0.3
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 faraday-net_http-1.0.1
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 faraday-net_http_persistent-1.2.0
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 faraday-patron-1.0.0
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 faraday-rack-1.0.0
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 faraday-retry-1.0.3
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 faraday_middleware-1.2.0
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 fastimage-2.2.6
drwxr-xr-x  25 kikeenrique  admin   800 Feb  4 02:05 fastlane-2.204.2
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 13:32 fastlane-plugin-badge-1.5.0
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 13:31 fastlane-plugin-google_chat-0.1.3
drwxr-xr-x  14 kikeenrique  admin   448 Feb  4 02:05 gh_inspector-1.1.3
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 google-apis-androidpublisher_v3-0.16.0
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 google-apis-core-0.4.2
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 google-apis-iamcredentials_v1-0.10.0
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 google-apis-playcustomapp_v1-0.7.0
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 google-apis-storage_v1-0.11.0
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 google-cloud-core-1.6.0
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 google-cloud-env-1.5.0
drwxr-xr-x   8 kikeenrique  admin   256 Feb  4 02:05 google-cloud-errors-1.2.0
drwxr-xr-x  12 kikeenrique  admin   384 Feb  4 02:05 google-cloud-storage-1.36.0
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 googleauth-1.1.0
drwxr-xr-x  20 kikeenrique  admin   640 Feb  4 02:05 highline-2.0.3
drwxr-xr-x  12 kikeenrique  admin   384 Feb  4 02:05 http-cookie-1.0.4
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 httpclient-2.8.3
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 jmespath-1.5.0
drwxr-xr-x  17 kikeenrique  admin   544 Feb  4 02:05 jwt-2.3.0
drwxr-xr-x  13 kikeenrique  admin   416 Feb  4 02:05 memoist-0.16.2
drwxr-xr-x   5 kikeenrique  admin   160 Feb  4 02:05 mini_magick-4.11.0
drwxr-xr-x  15 kikeenrique  admin   480 Feb  4 02:05 mini_mime-1.1.2
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 multi_json-1.15.0
drwxr-xr-x  12 kikeenrique  admin   384 Feb  4 02:05 multipart-post-2.0.0
drwxr-xr-x  17 kikeenrique  admin   544 Feb  4 02:05 nanaimo-0.3.0
drwxr-xr-x  11 kikeenrique  admin   352 Feb  4 02:05 naturally-2.2.1
drwxr-xr-x  15 kikeenrique  admin   480 Feb  4 02:05 os-1.1.4
drwxr-xr-x   4 kikeenrique  admin   128 Feb  4 02:05 plist-3.6.0
drwxr-xr-x  21 kikeenrique  admin   672 Feb  4 02:05 public_suffix-4.0.6
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 rake-13.0.6
drwxr-xr-x  14 kikeenrique  admin   448 Feb  4 02:05 representable-3.1.1
drwxr-xr-x  14 kikeenrique  admin   448 Feb  4 02:05 retriable-3.1.2
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 rexml-3.2.5
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 rouge-2.0.7
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 ruby2_keywords-0.0.5
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 rubyzip-2.3.2
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 security-0.1.3
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 signet-0.16.0
drwxr-xr-x  17 kikeenrique  admin   544 Feb  4 02:05 simctl-1.6.8
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 terminal-notifier-2.0.0
drwxr-xr-x  13 kikeenrique  admin   416 Feb  4 02:05 terminal-table-1.8.0
drwxr-xr-x  13 kikeenrique  admin   416 Feb  4 02:05 trailblazer-option-0.1.2
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 tty-cursor-0.7.1
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 tty-screen-0.8.1
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 tty-spinner-0.9.3
drwxr-xr-x  12 kikeenrique  admin   384 Feb  4 02:05 uber-0.1.0
drwxr-xr-x  12 kikeenrique  admin   384 Feb  4 02:05 unf-0.1.4
drwxr-xr-x  14 kikeenrique  admin   448 Feb  4 02:05 unf_ext-0.0.8
drwxr-xr-x   7 kikeenrique  admin   224 Feb  4 02:05 unicode-display_width-1.8.0
drwxr-xr-x   9 kikeenrique  admin   288 Feb  4 02:05 webrick-1.7.0
drwxr-xr-x  11 kikeenrique  admin   352 Feb  4 02:05 word_wrap-1.0.0
drwxr-xr-x  16 kikeenrique  admin   512 Feb  4 13:32 xcode-install-2.8.0
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 xcodeproj-1.21.0
drwxr-xr-x  19 kikeenrique  admin   608 Feb  4 02:05 xcpretty-0.3.0
drwxr-xr-x   6 kikeenrique  admin   192 Feb  4 02:05 xcpretty-travis-formatter-1.0.1
 $  ack claide /usr/local/Cellar/fastlane/2.204.2/libexec/gems
/usr/local/Cellar/fastlane/2.204.2/libexec/gems/xcode-install-2.8.0/xcode-install.gemspec
25:  spec.add_dependency 'claide', '>= 0.9.1', '< 1.1.0'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/xcode-install-2.8.0/lib/xcode/install/simulators.rb
1:require 'claide'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/xcode-install-2.8.0/lib/xcode/install/command.rb
1:require 'claide'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/.rubocop_todo.yml
12:    - 'lib/claide/command.rb'
23:    - 'lib/claide/command/banner.rb'
29:    - 'lib/claide/command/banner.rb'
37:    - 'lib/claide/argument.rb'
38:    - 'lib/claide/command.rb'
45:    - 'lib/claide/command/banner.rb'
50:    - 'lib/claide/command.rb'
56:    - 'lib/claide/ansi.rb'
57:    - 'lib/claide/argument.rb'
58:    - 'lib/claide/command.rb'
64:    - 'lib/claide/command/argument_suggester.rb'
70:    - 'lib/claide/command/argument_suggester.rb'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/claide.gemspec
3:require File.expand_path('../lib/claide/gem_version', __FILE__)
6:  s.name     = "claide"

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/CHANGELOG.md
36:* Avoid a method redefinition warning when requiring `claide`.
68:* Fix circular require of `claide/ansi` in `claide/ansi/string_escaper`.

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/README.md
3:[![Build Status](https://img.shields.io/github/workflow/status/CocoaPods/claide/ci)](https://github.com/CocoaPods/claide/actions)
4:[![Gem Version](https://img.shields.io/gem/v/claide)](https://rubygems.org/gems/claide)
13:$ [sudo] gem install claide

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/lib/claide.rb
7:  require 'claide/ansi'
8:  require 'claide/argument'
9:  require 'claide/argv'
10:  require 'claide/command'
11:  require 'claide/help'
12:  require 'claide/informative_error'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/lib/claide/ansi.rb
3:require 'claide/ansi/cursor'
4:require 'claide/ansi/graphics'
111:require 'claide/ansi/string_escaper'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/lib/claide/help.rb
4:  require 'claide/informative_error'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/lib/claide/command.rb
3:require 'claide/command/banner'
4:require 'claide/command/plugin_manager'
5:require 'claide/command/argument_suggester'
85:      #         Defaults to search for `claide` plugins.
88:        @plugin_prefixes ||= ['claide']

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/Gemfile.lock
4:    claide (1.1.0)
66:  claide!

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.1.0/.rubocop_cocoapods.yml
59:# Not always desirable: lib/claide/command/plugins_helper.rb:12:15

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/.rubocop_todo.yml
12:    - 'lib/claide/command.rb'
23:    - 'lib/claide/command/banner.rb'
29:    - 'lib/claide/command/banner.rb'
37:    - 'lib/claide/argument.rb'
38:    - 'lib/claide/command.rb'
45:    - 'lib/claide/command/banner.rb'
50:    - 'lib/claide/command.rb'
56:    - 'lib/claide/ansi.rb'
57:    - 'lib/claide/argument.rb'
58:    - 'lib/claide/command.rb'
64:    - 'lib/claide/command/argument_suggester.rb'
70:    - 'lib/claide/command/argument_suggester.rb'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/claide.gemspec
3:require 'claide'
6:  s.name     = "claide"

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/CHANGELOG.md
25:* Avoid a method redefinition warning when requiring `claide`.
57:* Fix circular require of `claide/ansi` in `claide/ansi/string_escaper`.

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/README.markdown
14:$ [sudo] gem install claide

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/lib/claide.rb
13:  require 'claide/ansi'
14:  require 'claide/argument'
15:  require 'claide/argv'
16:  require 'claide/command'
17:  require 'claide/help'
18:  require 'claide/informative_error'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/lib/claide/ansi.rb
3:require 'claide/ansi/cursor'
4:require 'claide/ansi/graphics'
111:require 'claide/ansi/string_escaper'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/lib/claide/help.rb
4:  require 'claide/informative_error'

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/lib/claide/command.rb
3:require 'claide/command/banner'
4:require 'claide/command/plugin_manager'
5:require 'claide/command/argument_suggester'
85:      #         Defaults to search for `claide` plugins.
88:        @plugin_prefixes ||= ['claide']

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/Gemfile.lock
4:    claide (1.0.3)
62:  claide!

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/claide-1.0.3/.rubocop_cocoapods.yml
56:# Not always desirable: lib/claide/command/plugins_helper.rb:12:15

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/command.rb
3:  require 'claide'
16:    self.plugin_prefixes = %w(claide xcodeproj)

/usr/local/Cellar/fastlane/2.204.2/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj.rb
3:  require 'claide'
triplef commented 2 years ago

Hi @rogerluan and @kikeenrique, thank you both for looking into this! ๐Ÿ™

I did install fastlane using RubyGems. No /usr/local/Cellar/fastlane.

I searched my Gems and the only one other than xcode-install requiring claide was xcodeproj, which doesnโ€™t restrict its version: https://github.com/CocoaPods/Xcodeproj/blob/master/Gemfile#L5

So I guess that somehow ended up installing claide-1.1.0, although I donโ€™t know how exactly this happened on this machine (our build server).

rogerluan commented 2 years ago

@triplef just wondering, is it possible for you to use a bundler installation instead of installing the gem in the machine directly? Bundler is the recommended way to install gems in general. Although we do support all other installation methods and should look into this, I think that if you can use bundler, it will get you to the solution faster ๐Ÿ˜ฌ

Unfortunately I don't have the bandwidth to investigate the RubyGems issue right now ๐Ÿ˜ž

edwarddeguzman commented 2 years ago

Also getting this error. Has anyone solved it yet?