Tôi đang cố gắng cài đặt edx Devstack bằng Vagrant và tôi đang sử dụng máy Windows. Tôi nhận được lỗi xuất hiện do kết quả từ các liên kết tượng trưng không được Windows hỗ trợ.Vagrant - paver devstack lỗi: "[Errno 20] Không phải là thư mục"
Theo hướng dẫn khắc phục sự cố edx theo Dealing with line endings and symlinks under Windows, tôi nên chạy các lệnh sau trong Cygwin để xử lý các liên kết tượng trưng.
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
Tôi cũng đã thử các lệnh trong câu trả lời SO cho Git symlinks in Windows, tạo ra kết quả tương tự.
Output:
Kết quả tôi nhận được sau khi chạy các lệnh trên là một chút kỳ quặc, vì vậy tôi không chắc chắn nếu kịch bản là thành công.
[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>
Tại sao nó đi vào dấu nhắc lệnh kiểu Windows ở cuối? Đây là nơi tôi không chắc liệu lệnh git có hoạt động hay không.
Trong Vagrant:
Sau khi chạy vagrant up
và vagrant ssh
, tôi nhận được lỗi sau khi chạy paver devstack lms
(đầu ra tương tự cho 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
Từ những gì tôi hiểu, đây là một vấn đề với các liên kết tượng trưng (Xem this bài đăng trên các nhóm của Google).
Tôi có đang chạy tập lệnh liên kết tượng trưng ở trên đúng không? Làm cách nào để kiểm tra xem các liên kết tượng trưng đã được xử lý thành công chưa?
nỗ lực khác:
Tiếp theo những gợi ý trong nhóm google (link ở trên), tôi cũng đã thực hiện những điều chỉnh như sau:
- thiết lập VAGRANT_USE_VBOXFS = true
- sử dụng Vagrantfile được cung cấp here
- đặt biến môi trường OPENEDX_RELEASE = "có tên giải phóng/bách"
- cài đặt libxmlsec1 từ phiên bản Vagrant.
Sau nhiều vagrant destroy
và vagrant provision
, tôi vẫn gặp phải vấn đề tương tự IOError: [Error 20] Not a directory
. Bất kì sự trợ giúp nào đều được đánh giá cao!
phiên bản:
- phiên bản Windows: 8
- Vagrant phiên bản: 1.7.4
- VirtualBox phiên bản: 5.0.8
- openEdx phát hành: tên phát hành/bách
bạn đang cố gắng để tạo/symlink sử dụng trong Windows, hoặc bạn đang cố gắng để tạo/symlink sử dụng trong VirtualBox (giả sử một máy ảo Linux)? – jperezov
@ Jonathan Tôi đang cố gắng sử dụng các liên kết tượng trưng trong các tệp được lưu trữ trên máy tính Windows của tôi và được chia sẻ qua VirtualBox với một máy ảo Linux ... Ít nhất tôi nghĩ đó là cách hoạt động mơ hồ. – Evelyn
Có một lỗi trong tập lệnh đầu tiên trong đó 'hash = $ (echo" $ 1 "| git hash-object -w --stdin); 'nên là' hash = $ (echo -n "$ 1" | git hash-object -w --stdin); '(lưu ý bổ sung" -n ") – venimus