2

我有一个使用 Django 框架用 python 编写的应用程序。我创建了适当的 requirements.txt(django 应用程序包),它在本地机器上运行良好。当我部署(推送到 Openshift)这个应用程序时,控制台给出如下错误

        Running setup.py install for libsass
    remote:     building '_sass' extension
    remote:     gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I./libsass -I/opt/rh/python27/root/usr/include/python2.7 -c libsass/ast.cpp -o build/temp.linux-x86_64-2.7/libsass/ast.o -c -O2 -fPIC -std=c++0x -Wall -Wno-parentheses
    remote:     In file included from libsass/ast.cpp:1:
    remote:     libsass/ast.hpp: In constructor 'Sass::Hashed::Hashed(size_t)':
    remote:     libsass/ast.hpp:213: error: 'class std::unordered_map<Sass::Expression*, Sass::Expression*, std::hash<Sass::Expression*>, std::equal_to<Sass::Expression*>, std::allocator<std::pair<Sass::Expression* const, Sass::Expression*> > >' has no member named 'reserve'
    remote:     libsass/ast.hpp: In member function 'Sass::Hashed& Sass::Hashed::operator+=(Sass::Hashed*)':
    remote:     libsass/ast.hpp:241: error: expected initializer before ':' token
    remote:     libsass/ast.hpp:245: error: could not convert 'Sass::Hashed::reset_duplicate_key()' to 'bool'
    remote:     libsass/ast.hpp:246: error: expected primary-expression before 'return'
    remote:     libsass/ast.hpp:246: error: expected ')' before 'return'
    remote:     libsass/ast.hpp: In member function 'virtual bool Sass::Map::operator==(Sass::Expression&) const':
    remote:     libsass/ast.hpp:751: error: expected initializer before ':' token
    remote:     libsass/ast.hpp:753: error: expected primary-expression before 'return'
    remote:     libsass/ast.hpp:753: error: expected ';' before 'return'
    remote:     libsass/ast.hpp:753: error: expected primary-expression before 'return'
    remote:     libsass/ast.hpp:753: error: expected ')' before 'return'
    remote:     libsass/ast.hpp: In member function 'virtual size_t Sass::Map::hash()':
    remote:     libsass/ast.hpp:766: error: expected initializer before ':' token
    remote:     libsass/ast.hpp:769: error: expected primary-expression before 'return'
    remote:     libsass/ast.hpp:769: error: expected ';' before 'return'
    remote:     libsass/ast.hpp:769: error: expected primary-expression before 'return'
    remote:     libsass/ast.hpp:769: error: expected ')' before 'return'
    remote:     libsass/ast.hpp: In member function 'virtual size_t Sass::Function_Call::hash()':
    remote:     libsass/ast.hpp:955: error: expected initializer before ':' token
    remote:     libsass/ast.hpp:958: error: expected primary-expression before 'return'
    remote:     libsass/ast.hpp:958: error: expected ';' before 'return'
    remote:     libsass/ast.hpp:958: error: expected primary-expression before 'return'
    remote:     libsass/ast.hpp:958: error: expected ')' before 'return'
    remote:     In file included from libsass/ast.cpp:1:
    remote:     libsass/ast.hpp: In member function 'virtual size_t Sass::String_Schema::hash()':
    remote:     libsass/ast.hpp:1325: error: expected initializer before ':' token
    remote:     libsass/ast.hpp:1328: error: expected primary-expression before 'return'
    remote:     libsass/ast.hpp:1328: error: expected ';' before 'return'
    remote:     libsass/ast.hpp:1328: error: expected primary-expression before 'return'
    remote:     libsass/ast.hpp:1328: error: expected ')' before 'return'
    remote:     error: command 'gcc' failed with exit status 1
    remote:     Complete output from command /var/lib/openshift/572c360289f5cfed3600001f/python/virtenv/bin/python2.7 -c "import setuptools;__file__='/var/lib/openshift/572c360289f5cfed3600001f/app-root/runtime/dependencies/python/virtenv/build/libsass/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mIRm4k-record/install-record.txt --single-version-externally-managed --install-headers /var/lib/openshift/572c360289f5cfed3600001f/app-root/runtime/dependencies/python/virtenv/include/site/python2.7:
    remote:     running install
    remote: 
    remote: running build
    remote: 
    remote: running build_py
    remote: 
    remote: creating build
    remote: 
    remote: creating build/lib.linux-x86_64-2.7
    remote: 
    remote: copying sass.py -> build/lib.linux-x86_64-2.7
    remote: 
    remote: copying sassc.py -> build/lib.linux-x86_64-2.7
    remote: 
    remote: copying sasstests.py -> build/lib.linux-x86_64-2.7
    remote: 
    remote: creating build/lib.linux-x86_64-2.7/sassutils
    remote: 
    remote: copying sassutils/__init__.py -> build/lib.linux-x86_64-2.7/sassutils
    remote: 
    remote: copying sassutils/builder.py -> build/lib.linux-x86_64-2.7/sassutils
    remote: 
    remote: copying sassutils/distutils.py -> build/lib.linux-x86_64-2.7/sassutils
    remote: 
    remote: copying sassutils/wsgi.py -> build/lib.linux-x86_64-2.7/sassutils
    remote: 
    remote: running build_ext
    remote: 
    remote: building '_sass' extension
    remote: 
    remote: creating build/temp.linux-x86_64-2.7
    remote: 
    remote: creating build/temp.linux-x86_64-2.7/libsass
    remote: 
    remote: gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I./libsass -I/opt/rh/python27/root/usr/include/python2.7 -c libsass/ast.cpp -o build/temp.linux-x86_64-2.7/libsass/ast.o -c -O2 -fPIC -std=c++0x -Wall -Wno-parentheses
    remote: 
    remote: In file included from libsass/ast.cpp:1:
    remote: 
    remote: libsass/ast.hpp: In constructor 'Sass::Hashed::Hashed(size_t)':
    remote: 
    remote: libsass/ast.hpp:213: error: 'class std::unordered_map<Sass::Expression*, Sass::Expression*, std::hash<Sass::Expression*>, std::equal_to<Sass::Expression*>, std::allocator<std::pair<Sass::Expression* const, Sass::Expression*> > >' has no member named 'reserve'
    remote: 
    remote: libsass/ast.hpp: In member function 'Sass::Hashed& Sass::Hashed::operator+=(Sass::Hashed*)':
    remote: 
    remote: libsass/ast.hpp:241: error: expected initializer before ':' token
    remote: 
    remote: libsass/ast.hpp:245: error: could not convert 'Sass::Hashed::reset_duplicate_key()' to 'bool'
    remote: 
    remote: libsass/ast.hpp:246: error: expected primary-expression before 'return'
    remote: 
    remote: libsass/ast.hpp:246: error: expected ')' before 'return'
    remote: 
    remote: libsass/ast.hpp: In member function 'virtual bool Sass::Map::operator==(Sass::Expression&) const':
    remote: 
    remote: libsass/ast.hpp:751: error: expected initializer before ':' token
    remote: 
    remote: libsass/ast.hpp:753: error: expected primary-expression before 'return'
    remote: 
    remote: libsass/ast.hpp:753: error: expected ';' before 'return'
    remote: 
    remote: libsass/ast.hpp:753: error: expected primary-expression before 'return'
    remote: 
    remote: libsass/ast.hpp:753: error: expected ')' before 'return'
    remote: 
    remote: libsass/ast.hpp: In member function 'virtual size_t Sass::Map::hash()':
    remote: 
    remote: libsass/ast.hpp:766: error: expected initializer before ':' token
    remote: 
    remote: libsass/ast.hpp:769: error: expected primary-expression before 'return'
    remote: 
    remote: libsass/ast.hpp:769: error: expected ';' before 'return'
    remote: 
    remote: libsass/ast.hpp:769: error: expected primary-expression before 'return'
    remote: 
    remote: libsass/ast.hpp:769: error: expected ')' before 'return'
    remote: 
    remote: libsass/ast.hpp: In member function 'virtual size_t Sass::Function_Call::hash()':
    remote: 
    remote: libsass/ast.hpp:955: error: expected initializer before ':' token
    remote: 
    remote: libsass/ast.hpp:958: error: expected primary-expression before 'return'
    remote: 
    remote: libsass/ast.hpp:958: error: expected ';' before 'return'
    remote: 
    remote: libsass/ast.hpp:958: error: expected primary-expression before 'return'
    remote: 
    remote: libsass/ast.hpp:958: error: expected ')' before 'return'
    remote: 
    remote: In file included from libsass/ast.cpp:1:
    remote: 
    remote: libsass/ast.hpp: In member function 'virtual size_t Sass::String_Schema::hash()':
    remote: 
    remote: libsass/ast.hpp:1325: error: expected initializer before ':' token
    remote: 
    remote: libsass/ast.hpp:1328: error: expected primary-expression before 'return'
    remote: 
    remote: libsass/ast.hpp:1328: error: expected ';' before 'return'
    remote: 
    remote: libsass/ast.hpp:1328: error: expected primary-expression before 'return'
    remote: 
    remote: libsass/ast.hpp:1328: error: expected ')' before 'return'
    remote: 
    remote: error: command 'gcc' failed with exit status 1
    remote: 
    remote: ----------------------------------------
    remote: Cleaning up...
    remote: Command /var/lib/openshift/572c360289f5cfed3600001f/python/virtenv/bin/python2.7 -c "import setuptools;__file__='/var/lib/openshift/572c360289f5cfed3600001f/app-root/runtime/dependencies/python/virtenv/build/libsass/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mIRm4k-record/install-record.txt --single-version-externally-managed --install-headers /var/lib/openshift/572c360289f5cfed3600001f/app-root/runtime/dependencies/python/virtenv/include/site/python2.7 failed with error code 1 in /var/lib/openshift/572c360289f5cfed3600001f/app-root/runtime/dependencies/python/virtenv/build/libsass
    remote: Traceback (most recent call last):
    remote:   File "/var/lib/openshift/572c360289f5cfed3600001f/python/virtenv/bin/pip", line 12, in <module>
    remote:     load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
    remote:   File "/var/lib/openshift/572c360289f5cfed3600001f/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/__init__.py", line 148, in main
    remote:     return command.main(args[1:], options)
    remote:   File "/var/lib/openshift/572c360289f5cfed3600001f/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 171, in main
    remote:     log_fp = open_logfile(log_fn, 'w')
    remote:   File "/var/lib/openshift/572c360289f5cfed3600001f/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 200, in open_logfile
    remote:     os.makedirs(dirname)
    remote:   File "/var/lib/openshift/572c360289f5cfed3600001f/python/virtenv/lib64/python2.7/os.py", line 157, in makedirs
    remote:     mkdir(name, mode)
    remote: OSError: [Errno 13] Permission denied: '/var/lib/openshift/572c360289f5cfed3600001f/.pip'

在这个回溯中,我可以看到 libsass 未能在 Openshift 中安装。有什么解决方案吗?. 还有人有这个问题吗 ?

4

0 回答 0