WSL2: Localhost 표시 방법

1841 단어 RailsUbuntuWSLtech

절차.


Step1


참고여기.제작c:\Users\<ユーザ名>\.wslconfig.wslconfig
localhostForwarding=True

Step2


WSL: Ubuntu 재시작
Windows 명령 프롬프트에서 wsl을 닫습니다(이후 자동으로 시작).
$ wsl --shutdown
이상 wsl:Ubuntu에localhost를 표시합니다.

보충:postgresql을 통해 환경을 구축하는 상황


postgresql을 통해 환경을 구축할 때localhost를 표시할 때
"PG::ConnectionBad"오류가 표시됩니다.
postgresqlエラー
그때postgresql 서비스를 시작합니다.
$ sudo service postgresql status # 状態確認: ダウンしている
12/main (port 5432): down
$ sudo service postgresql start # postgres起動
 * Starting PostgreSQL 12 database server
$ sudo service postgresql status # 起動されている
12/main (port 5432): online
postgresql을 사용하는 사람은localhost를 표시할 수 있습니다.

좋은 웹페이지 즐겨찾기