我試圖讓安裝了Vagrant的edx Devstack,我在Windows機器上。我收到的錯誤似乎是由Windows不支持的符號鏈接導致的。Vagrant - 攤鋪機devstack錯誤:「[Errno 20]不是目錄」
根據Dealing with line endings and symlinks under Windows下的edx故障排除指南,我應該在cygwin中運行以下命令來處理符號鏈接。
git rm --cached -r . && git reset --hard
git config --global alias.add-symlink '!__git_add_symlink(){
dst=$(echo "$2")/../$(echo "$1");
if [ -e "$dst" ]; then
hash=$(echo "$1" | git hash-object -w --stdin);
git update-index --add --cacheinfo 120000 "$hash" "$2";
git checkout -- "$2";
else
echo "ERROR: Target $dst does not exist!";
echo " Not creating invalid symlink.";
fi;
}; __git_add_symlink "$1" "$2"'
git config --global alias.rm-symlink '!__git_rm_symlink(){
git checkout -- "$1"; link=$(echo "$1");
POS=$'\''/'\''; DOS=$'\''\\\\'\'';
doslink=${link//$POS/$DOS};
dest=$(dirname "$link")/$(cat "$link");
dosdest=${dest//$POS/$DOS};
if [ -f "$dest" ]; then
rm -f "$link";
cmd //C mklink //H "$doslink" "$dosdest";
elif [ -d "$dest" ]; then
rm -f "$link";
cmd //C mklink //J "$doslink" "$dosdest";
else
echo "ERROR: Something went wrong when processing $1 . . .";
echo " $dest may not actually exist as a valid target.";
fi;
}; __git_rm_symlink "$1"'
git config --global alias.rm-symlinks '!__git_rm_symlinks(){
for symlink in `git ls-files -s | grep -E "^120000" | cut -f2`;
do
git rm-symlink "$symlink";
git update-index --assume-unchanged "$symlink";
done;
}; __git_rm_symlinks'
git config --global alias.checkout-symlinks '!__git_checkout_symlinks(){
POS=$'\''/'\''; DOS=$'\''\\\\'\'';
for symlink in `git ls-files -s | grep -E "^120000" | cut -f2`;
do
git update-index --no-assume-unchanged "$symlink";
if [ -d "$symlink" ]; then
dossymlink=${symlink//$POS/$DOS};
cmd //C rmdir //S //Q "$dossymlink";
fi;
git checkout -- "$symlink";
echo "Restored git symlink $symlink <<===>> `cat $symlink`";
done;
}; __git_checkout_symlinks'
git rm-symlinks
我也嘗試過在SO的答案Git symlinks in Windows,這產生了相同的結果。
輸出:
運行上面的命令後,我得到的輸出是一個有點古怪,所以我不知道,如果劇本是成功的。
[email protected] /cygdrive/c/.../Local/devstack/edx-platform/edx-platform $./symlinks-fix.sh
**Git checkout output**
...
Checking out files: 100% (6983/6983), done.
HEAD is now at 222bdd9 Merge pull request #10411 from edx/mobile/course-blocks-api
Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.
C:\Users\...\Local\devstack\edx-platform\edx-platform>
爲什麼它會在最後進入Windows風格的命令提示符?這是我不確定git命令是否正常工作的地方。
在流浪:
運行vagrant up
和vagrant ssh
,運行paver devstack lms
當我得到以下錯誤(類似於輸出paver devstack studio
)後:
[email protected]:~$ sudo su edxapp
[email protected]:~/edx-platform$ paver devstack lms
...
pip install -q --disable-pip-version-check --exists-action w -r requirements/edx/github.txt
Could not find a tag or branch '96e1922348bfe6d99201b9512a9ed946c87b7e0b', assuming commit.
.... 20 similar ....
Could not find a tag or branch 'e7a6c95c300e95c51e42bfd1eba70489c05a6527', assuming commit.
pip install -q --disable-pip-version-check --exists-action w -r requirements/edx/local.txt
pip install -q --disable-pip-version-check --exists-action w -r requirements/edx/base.txt
Requested meliae==0.4.0 (from -r requirements/edx/base.txt (line 47)), but installing version 0.4.0.final.0
pip install -q --disable-pip-version-check --exists-action w -r requirements/edx/post.txt
python manage.py cms --settings=devstack reindex_course --setup
2015-11-06 01:37:40,353 WARNING 4797 [xblock.plugin] plugin.py:147 - Unable to load XBlock 'html'
Traceback...
IOError: [Errno 20] Not a directory: '/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/js/common_static/js/vendor/draggabilly.pkgd.js'
2015-11-06 01:37:40,660 WARNING 4797 [xblock.plugin] plugin.py:147 - Unable to load XBlock 'course_info'
Traceback...
IOError: [Errno 20] Not a directory: '/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/js/common_static/js/vendor/draggabilly.pkgd.js'
Traceback...
IOError: [Errno 20] Not a directory: '/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/js/common_static/js/vendor/draggabilly.pkgd.js'
Traceback ...
IOError: [Errno 20] Not a directory: '/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/js/common_static/js/vendor/draggabilly.pkgd.js'
Traceback ...
IOError: [Errno 20] Not a directory: '/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/js/common_static/js/vendor/draggabilly.pkgd.js'
Build failed running pavelib.servers.devstack: Subprocess return code: 1
據我瞭解,這是一個問題與符號鏈接(請參閱Google羣組上的this發佈)。
我是否正確運行上述符號鏈接腳本?如何檢查符號鏈接是否已成功處理?
其他嘗試:
繼谷歌組(以上鍊接)的建議,我也做了如下調整:
- 使用Vagrantfile設置VAGRANT_USE_VBOXFS =真
- 提供here
- 設置環境變量OPENEDX_RELEASE =「named-release/cypress」
- 從Vagrant實例安裝libxmlsec1。
後多vagrant destroy
和vagrant provision
的,我仍然有同樣的問題IOError: [Error 20] Not a directory
。任何幫助將非常感激!
版本:
- Windows版本:8
- 流浪版本:1.7.4
- VirtualBox的版本:5.0。8
- openEdx發佈:命名發佈/柏
你們是不是在Windows中創建/使用符號鏈接,或者是你想創建的VirtualBox /使用符號連接(假設一個Linux VM)? – jperezov
@Jonathan我試圖在我的Windows機器上存儲的文件中使用符號鏈接,並通過VirtualBox將它們共享到一個linux虛擬機......至少我認爲這就是流浪漢的工作原理。 – Evelyn
第一個腳本中有一個錯誤,其中'hash = $(echo「$ 1」| git hash-object -w --stdin); '應該是'hash = $(echo -n「$ 1」| git hash-object -w --stdin); '(注意附加的「-n」) – venimus