2016-11-28 4 views
0

私はRubyに精通していませんが、いくつかのRubyネイティブエクステンションをビルドする必要があるシステムユーティリティを使用しています。私は、インストールコマンドを実行しようとすると、私は次のスタックトレースを取得する:様々な理由Rubyネイティブエクステンションのtmpディレクトリを変更する

Building native extensions. This could take a while... 
ERROR: Error installing sensu-plugins-http: 
    ERROR: Failed to build gem native extension. 

    current directory: /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.7.2/ext/unf_ext 
/opt/sensu/embedded/bin/ruby -r ./siteconf20161128-17526-tzlgio.rb extconf.rb 
checking for main() in -lstdc++... yes 
creating Makefile 

To see why this extension failed to compile, please check the mkmf.log which can be found here: 

    /opt/sensu/embedded/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/unf_ext-0.0.7.2/mkmf.log 

current directory: /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.7.2/ext/unf_ext 
make "DESTDIR=" clean 

current directory: /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.7.2/ext/unf_ext 
make "DESTDIR=" 
compiling unf.cc 
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ [enabled by default] 
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++ [enabled by default] 
unf.cc:75:1: fatal error: error writing to /tmp/ccyXxObQ.s: No space left on device 
compilation terminated. 
make: *** [unf.o] Error 1 

make failed, exit code 2 

は、私の/tmp/ディレクトリが意図的に小さいです。 Ruby/gccにビルドプロセスの別の一時的な場所を使用させる方法があるのでしょうか?

答えて

0

はい。コンパイルする前にTMPDIR環境変数を設定します。

TMPDIR TMPDIRが設定されている場合

を、それが 一時ファイル用に使用するディレクトリを指定します。 GCCはテンポラリファイルを使用して、 コンパイルの段階を次の段階への入力として使用します: たとえば、 コンパイラへの入力であるプリプロセッサの出力。

出典:
https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html

関連する問題