{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Install Swift 3: swiftenv","type":"basic","slug":"install-swift-3-swiftenv","excerpt":"","body":"To install Vapor, you just need to have Swift 3 installed.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Swiftenv\"\n}\n[/block]\nSwiftenv allows you to easily maintain multiple versions of Swift 3 on your computer. Learn more at <a href=\"https://github.com/kylef/swiftenv\">Swiftenv's GitHub</a>.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Install with Homebrew\"\n}\n[/block]\nWe will cover how to install Swiftenv with Homebrew, since that is the easiest method. If you would like to install it a different way, visit the <a href=\"https://github.com/kylef/swiftenv\">Swiftenv README</a>.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"brew install kylef/formulae/swiftenv\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nNow add it to your PATH. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" # OS X\\n echo 'if which swiftenv > /dev/null; then eval \\\"$(swiftenv init -)\\\"; fi' >> ~/.bash_profile\\n source ~/.bash_profile\\n \\n # Ubuntu\\n  echo 'if which swiftenv > /dev/null; then eval \\\"$(swiftenv init -)\\\"; fi' >> ~/.bashrc\\n source ~/.bashrc\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThis will make sure Swiftenv is enabled whenever you start a new terminal session. That way, when you type a command like `swift build`, it will automatically use the correct Swift version for the project you are working in.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Swift Version Files\",\n  \"body\": \"Hidden files called `.swift-version` exist in many Swift 3 projects that indicate to Swiftenv which version of Swift should be used to compile.\\n\\nAll Qutheory modules have this file.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Install Swift\"\n}\n[/block]\nOnce you have the `swiftenv` command installed, install the appropriate version of Swift for Vapor `0.12`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"swiftenv install DEVELOPMENT-SNAPSHOT-2016-06-20-a\\nswiftenv global DEVELOPMENT-SNAPSHOT-2016-06-20-a\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThis both installs the snapshot and sets it as the default installation of Swift 3 in case a `.swift-version` file is not present.","updates":["5775814497a3830e004bcd45"],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5768701b72cd4c0e000fad2b","githubsync":"","version":{"version":"0.12","version_clean":"0.12.0","codename":"Client Clyde","is_stable":false,"is_beta":true,"is_hidden":false,"is_deprecated":true,"categories":["5768701b72cd4c0e000fad19","5768701b72cd4c0e000fad1a","5768701b72cd4c0e000fad1b","5768701b72cd4c0e000fad1c"],"_id":"5768701b72cd4c0e000fad18","releaseDate":"2016-06-20T22:37:15.641Z","__v":1,"createdAt":"2016-06-20T22:37:15.641Z","project":"57086fe855a4690e005de407"},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Getting Started","slug":"documentation","order":0,"from_sync":false,"reference":false,"_id":"5768701b72cd4c0e000fad19","createdAt":"2016-04-09T02:58:48.377Z","__v":0,"project":"57086fe855a4690e005de407","version":"5768701b72cd4c0e000fad18"},"createdAt":"2016-05-18T23:04:37.823Z","user":"57086f3d447c410e00221bd1","__v":6,"parentDoc":null,"project":"57086fe855a4690e005de407"}

Install Swift 3: swiftenv


To install Vapor, you just need to have Swift 3 installed. [block:api-header] { "type": "basic", "title": "Swiftenv" } [/block] Swiftenv allows you to easily maintain multiple versions of Swift 3 on your computer. Learn more at <a href="https://github.com/kylef/swiftenv">Swiftenv's GitHub</a>. [block:api-header] { "type": "basic", "title": "Install with Homebrew" } [/block] We will cover how to install Swiftenv with Homebrew, since that is the easiest method. If you would like to install it a different way, visit the <a href="https://github.com/kylef/swiftenv">Swiftenv README</a>. [block:code] { "codes": [ { "code": "brew install kylef/formulae/swiftenv", "language": "shell" } ] } [/block] Now add it to your PATH. [block:code] { "codes": [ { "code": " # OS X\n echo 'if which swiftenv > /dev/null; then eval \"$(swiftenv init -)\"; fi' >> ~/.bash_profile\n source ~/.bash_profile\n \n # Ubuntu\n echo 'if which swiftenv > /dev/null; then eval \"$(swiftenv init -)\"; fi' >> ~/.bashrc\n source ~/.bashrc", "language": "text" } ] } [/block] This will make sure Swiftenv is enabled whenever you start a new terminal session. That way, when you type a command like `swift build`, it will automatically use the correct Swift version for the project you are working in. [block:callout] { "type": "info", "title": "Swift Version Files", "body": "Hidden files called `.swift-version` exist in many Swift 3 projects that indicate to Swiftenv which version of Swift should be used to compile.\n\nAll Qutheory modules have this file." } [/block] [block:api-header] { "type": "basic", "title": "Install Swift" } [/block] Once you have the `swiftenv` command installed, install the appropriate version of Swift for Vapor `0.12`. [block:code] { "codes": [ { "code": "swiftenv install DEVELOPMENT-SNAPSHOT-2016-06-20-a\nswiftenv global DEVELOPMENT-SNAPSHOT-2016-06-20-a", "language": "text" } ] } [/block] This both installs the snapshot and sets it as the default installation of Swift 3 in case a `.swift-version` file is not present.