Hi,I am newbie swift learner and was trying to install swift environment. I am stuck and I would appreciate your help. I have Xcode 13.0 and swift 5.5 installed.
Here is what I did to install swift environment:
1)git clone GitHub - kylef/swiftenv: Swift Version Manager ~/.swiftenv
2)nano ~/.bash_profile
everything was empty there so I wrote as follows: #swiftenv
export SWIFTENV_ROOT="$HOME/.swiftenv"
export PATH="$SWIFTENV_ROOT/BIN:$PATH"
eval "$(swiftenv init -)"
Then I saved it.
3)wrote ~./bash_profile
4)swiftenv
5)swift versions
got an error:
error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-versions (No such file or directory)
6) for once I ignored this and wrote: cd /Library/Developer/Toolchains
7)pwd
8) ls-la
9)I got
total 0
drwxr-xr-x 4 root wheel 128 Oct 19 20:45 .
drwxr-xr-x 4 root admin 128 Oct 19 20:45 ..
drwxr-xr-x 7 root wheel 224 Oct 19 20:45 swift-5.5-RELEASE.xctoolchain
lrwxr-xr-x 1 root wheel 59 Oct 19 20:45 swift-latest.xctoolchain -> /Library/Developer/Toolchains/swift-5.5-RELEASE.xctoolchain
10) cd ~/Desktop/
11)swiftenv global
zsh displayed: swiftenv: version is not set
Now,Here at this point I felt there is something wrong.
Modern macOS systems use zsh, not bash, as the default shell, so you'll need to modify the appropriate files for that shell (~/.zprofile) or switch to bash.