xcpretty / xcode-install

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

xcversion: command not found #255

Closed neilpanchal closed 6 years ago

neilpanchal commented 6 years ago

I have the gem installed

gem install xcode-install
Successfully installed xcode-install-2.3.1
Parsing documentation for xcode-install-2.3.1
Done installing documentation for xcode-install after 0 seconds
1 gem installed

Gem environment shows:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.5.2
  - RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [universal.x86_64-darwin17]
  - INSTALLATION DIRECTORY: /Users/carbon/.gem
  - USER INSTALLATION DIRECTORY: /Users/carbon/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/carbon/.gem/bin
  - SPEC CACHE DIRECTORY: /Users/carbon/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-17
  - GEM PATHS:
     - /Users/carbon/.gem
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/carbon/Dev/anaconda/bin
     - /Developer/NVIDIA/CUDA-9.1/bin
     - /Library/Frameworks/Python.framework/Versions/3.6/bin
     - /usr/bin
     - /usr/local/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /Applications/VMware Fusion.app/Contents/Public
     - /opt/X11/bin
     - /Users/carbon/Dev/esp/xtensa-esp32-elf/bin

How come xcversion is not found?

neilpanchal commented 6 years ago

I found an obvious problem, compiled gems were not in the PATH. I added the following lines to my .bash_profile:

export GEM_HOME=~/.gem
export GEM_PATH=~/.gem
export PATH=$PATH:$HOME/.gem/bin

Closing the issue.

juliusbangert commented 5 years ago

I was having the same issue and I tried your answer and it worked in so far as I was able to use diversion, but now pod install doesn't work for me.

I had to install ruby with home-brew in order to successfully run gem install xcode-install . Do you think that this, in combination with your suggestion could be the cause of my problems?

SwatiMaheshwari commented 2 years ago

I am facing same issue even after updating bash profile.

rogerluan commented 2 years ago

@SwatiMaheshwari nowadays modern macOS defaults to zsh instead of bash, so you have to update your ~/.zshrc instead of your bash profile file.