xcpretty / xcode-install

🔽 Install and update your Xcodes
https://fastlane.tools
MIT License
2.59k stars 243 forks source link

Errors when using ruby 2.5.0 #257

Closed klaaspieter closed 6 years ago

klaaspieter commented 6 years ago
$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]

$ gem uninstall xcode-install
Remove executables:
        xcversion, 🎉

in addition to the gem? [Yn]  y
Removing xcversion
Removing 🎉
Successfully uninstalled xcode-install-2.3.1

$ gem install xcode-install
Fetching: xcode-install-2.3.1.gem (100%)
Successfully installed xcode-install-2.3.1
Parsing documentation for xcode-install-2.3.1
Installing ri documentation for xcode-install-2.3.1
Done installing documentation for xcode-install after 0 seconds
1 gem installed

$ xcversion
Traceback (most recent call last):
        22: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/bin/xcversion:23:in `<main>'
        21: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems.rb:309:in `activate_bin_path'
        20: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems.rb:309:in `synchronize'
        19: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems.rb:311:in `block in activate_bin_path'
        18: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems.rb:239:in `finish_resolve'
        17: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:88:in `require'
        16: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:1106:in `find_in_unresolved_tree'
        15: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:1106:in `each'
        14: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:1107:in `block in find_in_unresolved_tree'
        13: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:2650:in `traverse'
        12: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:2650:in `each'
        11: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:2652:in `block in traverse'
        10: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/dependency.rb:302:in `to_specs'
         9: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/dependency.rb:283:in `matching_specs'
         8: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:88:in `require'
         7: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:1106:in `find_in_unresolved_tree'
         6: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:1106:in `each'
         5: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:1107:in `block in find_in_unresolved_tree'
         4: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:2650:in `traverse'
         3: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:2650:in `each'
         2: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/specification.rb:2652:in `block in traverse'
         1: from /Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/dependency.rb:302:in `to_specs'
/Users/klaaspieter/.asdf/installs/ruby/2.5.0/lib/ruby/2.5.0/rubygems/dependency.rb:283:in `matching_specs': uninitialized constant Gem::BundlerVersionFinder (NameError)
Did you mean?  Gem::BundlerVersionFinder
KrauseFx commented 6 years ago

Looks like a RubyGems error, could you try using a Gemfile for your setup?

klaaspieter commented 6 years ago

That works. I, and I expect most others, use xcversion system-wide so I would like this to work without a Gemfile. Is this a problem on my machine?

klaaspieter commented 6 years ago

Hah. I searched for uninitialized constant "Gem::BundlerVersionFinder" and the only result was fastlane/fastlane#11048.

Just like in fastlane/fastlane#11048, gem cleanup worked here too.

For future reference I did:

$ gem update
$ gem update --system
$ gem install bundler
$ gem cleanup

The last step fixed the issue, but it's possible some of the others are required as well.

wolffan commented 6 years ago

That helped me as well! thanks

jondkelley commented 5 years ago

gem cleanup +1