2017-02-04 24 views
0

私はubuntu 16.04(ドッカーのコンテナ内)で作業しています。システムの共有ライブラリの問題R

librofficeがインストールされ、正常に動作します。

私は、コマンドラインでそれを使用することができます

:任意のアイデアを

R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 
Copyright (C) 2016 The R Foundation for Statistical Computing 
Platform: x86_64-pc-linux-gnu (64-bit) 

R is free software and comes with ABSOLUTELY NO WARRANTY. 
You are welcome to redistribute it under certain conditions. 
Type 'license()' or 'licence()' for distribution details. 

    Natural language support but running in an English locale 

R is a collaborative project with many contributors. 
Type 'contributors()' for more information and 
'citation()' on how to cite R or R packages in publications. 

Type 'demo()' for some demos, 'help()' for on-line help, or 
'help.start()' for an HTML browser interface to help. 
Type 'q()' to quit R. 

[Previously saved workspace restored] 

> system("whoami") 
root 
> system(paste0("libreoffice --version")) 
/usr/lib/libreoffice/program/soffice.bin: error while loading shared libraries: libreglo.so: cannot open shared object file: No such file or directory 
> system(paste0("libreoffice --headless --convert-to pdf --outdir . rapport.docx")) 
/usr/lib/libreoffice/program/javaldx: error while loading shared libraries: libreglo.so: cannot open shared object file: No such file or directory 
Warning: failed to read path from javaldx 
/usr/lib/libreoffice/program/soffice.bin: error while loading shared libraries: libreglo.so: cannot open shared object file: No such file or directory 

私は、この共有ライブラリのエラーを理解しない... :

[email protected]:/# libreoffice --version 
LibreOffice 5.2.4.2.1 20m0(Build:2) 
[email protected]:/# libreoffice --headless --convert-to pdf --outdir . rapport.docx                
convert /rapport.docx -> /rapport.pdf using filter : writer_pdf_Export 
[email protected]:/# 

しかし、私はRで同じことをしようとした場合?

よろしく

答えて

0

ただ、永久LD_LIBRARY_PATH環境変数を経由して、あるいはただ一つのコマンドのディレクトリ/etc/ld.so.conf.d/.confで終わるファイルを追加することによって、ライブラリパスを設定します。

[email protected]:~$ LD_LIBRARY_PATH=/usr/lib/libreoffice/program/ R 

R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 
Copyright (C) 2016 The R Foundation for Statistical Computing 
Platform: x86_64-pc-linux-gnu (64-bit) 

R is free software and comes with ABSOLUTELY NO WARRANTY. 
You are welcome to redistribute it under certain conditions. 
Type 'license()' or 'licence()' for distribution details. 

    Natural language support but running in an English locale 

R is a collaborative project with many contributors. 
Type 'contributors()' for more information and 
'citation()' on how to cite R or R packages in publications. 

Type 'demo()' for some demos, 'help()' for on-line help, or 
'help.start()' for an HTML browser interface to help. 
Type 'q()' to quit R. 

R> system(paste0("libreoffice --version")) 
LibreOffice 5.2.2.2 20m0(Build:2) 

R> 

編集:実際には、ここではenv.varとも動作するため、他の何かが間違っている可能性があります。

[email protected]:~$ R 

R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" 
Copyright (C) 2016 The R Foundation for Statistical Computing 
Platform: x86_64-pc-linux-gnu (64-bit) 

R is free software and comes with ABSOLUTELY NO WARRANTY. 
You are welcome to redistribute it under certain conditions. 
Type 'license()' or 'licence()' for distribution details. 

    Natural language support but running in an English locale 

R is a collaborative project with many contributors. 
Type 'contributors()' for more information and 
'citation()' on how to cite R or R packages in publications. 

Type 'demo()' for some demos, 'help()' for on-line help, or 
'help.start()' for an HTML browser interface to help. 
Type 'q()' to quit R. 

R> system(paste0("libreoffice --version")) 
LibreOffice 5.2.2.2 20m0(Build:2) 

R> 
+0

ありがとう!完璧です( '/ etc/ls.so.conf.d/libc.conf'を編集して少しsudo ldconfigを使います) –

+0

はい、変更後に' ldconfig'を実行する必要があります。 'ldconfig -p | grep libreglo'も良いチェックです。そして私のためにロメインにお会いしましょう。 –

+0

私は;))よろしく –