Windows10에서 Ubuntu18.04+Swift5.1.4+Vapor3.1.10 사용해 보기
4732 단어 Vaporubuntu18.04Swift5Windows10
먼저 우분투를 넣으십시오.
Windows 기능 활성화에서 검색하여 Windows Subsystem for Linux 확인을 켭니다!

Microsoft Store에서 우분투에서 검색합니다.
우분투, 우분투 18.04 LTS, 우분투 16.04 LTS가 나왔다.

Ubuntu는 최신 LTS가 들어가는 것 같기 때문에 「입수」, 「기동」합니다.

콘솔이 열리고 사용자 이름과 암호를 입력하여 종료.
업데이트
sudo apt-get update
sudo apt-get install clang libicu-dev
Swift를 가져옵니다. 현재의 최신은 5.1.4
URL은 Sift. 오 rg에서 얻을 수 있습니다.
wget https://swift.org/builds/swift-5.1.4-RELEASE/ubuntu1804/swift-5.1.4-RELEASE/swift-5.1.4-RELEASE-ubuntu18.04.tar.gz
Swift를 확장하여/usr/local로 가져옵니다.
tar xzf swift-5.1.4-RELEASE-ubuntu18.04.tar.gz
sudo mv swift-5.1.4-RELEASE-ubuntu18.04 /usr/local
.bashrc에서 PATH에 추가
echo 'export PATH=/usr/local/swift-5.1.4-RELEASE-ubuntu18.04/usr/bin:$PATH' >> .bashrc
source .bashrc
안전하게 들어갔습니다.
swift --version

아직 swift가 거의 모르기 때문에 atmarkit에서 "초보자를위한 Swift로 시작하는 프로그래밍 입문"의 언어 부분만 읽어 보겠습니다.
드디어 Vapor를 설치합니다만, 공식 페이지 에 ubutu의 인스톨 방법 실고 있습니다.
4.0은 Swift5.2가 필요하고 도움말도 적기 때문에 멈추어 두었습니다.
sudo apt-get install curl
eval "$(curl -sL https://apt.vapor.sh)"
wget -q https://repo.vapor.codes/apt/keyring.gpg -O- | sudo apt-key add -
echo "deb https://repo.vapor.codes/apt $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vapor.list
sudo apt-get update
sudo apt-get install swift vapor
vapor --version

Vapor도 설치할 수 있었으므로 「Hello World」갑니다.
vapor new Hello
여기서 git의 에러가 나왔습니다만, 뭐 git이므로 좋다고 한다.

Vapor의 프로젝트 Hello가 생겼습니다.

다음은 Hello로 이동하고 xcode?
cd Hello
vapor xcode
y에서 오류

Error: backgroundExecute(code: 4, error: "open: ioctl(VT_GETSTATE): Inappropriate ioctl for device\n", output: "")
음. Yes는 Mac에서 Xcode가 없으면 안 된다.
Swift까지는 문제없이 움직이고 있었기 때문에 swift로 빌드라든지 해본다.
swift build
deprecated라든지 warning으로 하고 있습니다만···버전 있어 있지 않은 것인가? 원래 빌드하는 것이 좋았습니까?
신경을 쓰고 다시 vapor xcode로 no로 해본다.

통과했다!
빌드해 보겠습니다.
vapor build

성공
실행해 보겠습니다.
vapor run serve
움직였습니다.

브라우저로 액세스 해 보면 ...

움직이는 것이 좋았습니다.
Reference
이 문제에 관하여(Windows10에서 Ubuntu18.04+Swift5.1.4+Vapor3.1.10 사용해 보기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ArimitsuIshii/items/f29a24fd15e2a511dcf0텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)