我正在尝试使用 Vagrant 安装 edx Devstack,并且我在 Windows 机器上。我收到的错误似乎是由 Windows 不支持的符号链接引起的。
根据处理 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 answer to Git symlinks in Windows中的命令,产生了相同的结果。
输出:
运行上述命令后得到的输出有点奇怪,所以我不确定脚本是否成功。
User@Computer /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
and后vagrant ssh
,运行时出现以下错误paver devstack lms
(类似的输出paver devstack studio
):
vagrant@precise64:~$ sudo su edxapp
edxapp@precise64:~/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 群组上的 这篇文章)。
我是否正确运行上述符号链接脚本?如何检查符号链接是否已成功处理?
其他尝试:
按照google群里的建议(上面的链接),我也做了如下调整:
- 设置 VAGRANT_USE_VBOXFS = true
- 使用此处提供的 Vagrantfile
- 设置环境变量 OPENEDX_RELEASE="named-release/cypress"
- 从 Vagrant 实例安装 libxmlsec1。
在多个vagrant destroy
and之后vagrant provision
,我仍然有同样的IOError: [Error 20] Not a directory
问题。任何帮助将非常感激!
版本:
- 视窗版本:8
- 流浪者版本:1.7.4
- VirtualBox 版本:5.0.8
- openEdx 发布:命名发布/柏树