Nikolay
(Nikolay)
1월 23, 2020, 10:35오전
1
안녕하세요, 윈도우에서 개발을 할 수 없는데, 흰 화면만 뜨거든요. 콘솔을 열면 다음과 같은 오류가 나요:
(X) ember_jquery.js?1579775136.5740232:1 Uncaught Error: Errno::EEXIST: File exists @ dir_s_mkdir - /var/discourse/tmp/cache/assets/sprockets/v3.0/pr
(in /home/gaijinsailor/.rbenv/versions/2.6.2/lib/ruby/2.6.0/fileutils.rb:239:in `mkdir')
at ember_jquery.js?1579775136.5740232:1
그리고 비슷한 오류가 많이 나요.
결국, discourse가 스크립트를 로드하지 못하는 거예요. 스크립트를 별도 창에서 열면 다음과 같은 오류가 나요:
Script: http://localhost:3000/assets/locales/en_US.js?1579775136.5398135
Body: throw Error("Errno::EEXIST: File exists @ dir_s_mkdir - /var/discourse/tmp/cache/assets/sprockets/v3.0/x2\n (in /home/gaijinsailor/.rbenv/versions/2.6.2/lib/ruby/2.6.0/fileutils.rb:239:in `mkdir')")
그래서 파고들다 보니, 문제가 sprockets 때문이라는 걸 알게 되었어요. 저는 discourse 디렉터리를 윈도우에서 docker에 마운트했는데, 파일 시스템은 대소문자를 구분하지 않아요. 그리고 sprockets는 대소문자를 구분할 수 있는 Linux 계열 파일 시스템(예: ext4)에서만 작동하는 것 같아요.
이 문제에 대한 해결책이 있을까요?
감사합니다
UPD: 이 sprockets 관련 이슈는 GitHub에 문서화되어 있습니다: FileStore cache patch in v3.6 causes directory name collisions in Windows · Issue #283 · rails/sprockets · GitHub
하지만 이슈는 아직 열려 있고, 해결책이 없습니다
sam
(Sam Saffron)
1월 28, 2020, 6:36오전
2
재미있는 점은 @pixeltrix가 어제 이 문제를 발견하고 이 해킹으로 우회했다는 것입니다:
committed 12:09PM - 27 Jan 20 UTC
Sprockets 3.0 and later uses Base64 digests for cache paths and these
present pr… oblems when used with NTFS on Windows which is case-insensitive.
By allowing the overriding of the cache path from an environment variable
we can use a Docker volume to cache the asset compilation. This is actually
faster on both Mac and Windows than the default path.
훨씬 빠르고 이해하기 쉬운 WSL2 세팅을 사용하도록 WSL2를 설치하는 것을 권장합니다:
This tutorial has been tested on Windows 10 and 11.
To set up a development environment for Discourse on Windows, you can do it using Windows Subsystem for Linux feature.
This setup requires the WSL 2 installation. It is only available in Windows 10 builds 18917 or higher. We’ll assume that you already installed Windows Subsystem for Linux 2 (Ubuntu) on your Windows 10 system. WARNING: Install Ubuntu 18.04, and not 20.04 since some installations will fail on 20.04. For m…
개발 환경 설치는 매우 간단합니다. WSL2를 구동하고, docker를 설치한 다음, 우리의 docker 개발 세팅을 사용하면 됩니다.
Developing using Docker
Since Discourse runs in Docker, you should be able to run Discourse directly from your source directory using a Discourse development container.
Pros: No need to install any system dependencies, no configuration needed at all for setting up a development environment quickly.
Cons: Will be slightly slower than the native dev environment on Ubuntu, and much slower than a native install on MacOS.
See also Developing Discourse using a Dev Container …
Nikolay
(Nikolay)
1월 28, 2020, 10:10오전
3
매우 감사합니다. 해킹이 성공적으로 작동했습니다.
나중에 WSL2를 사용해보겠습니다.