せまい部屋

web/gameエンジニアのweblog

knife-solo途中でエラー

問題

サーバープロビジョニングとかいう如何にもおフランスナウい分野の勉強を兼ねてchef実践入門読書中にgemあたりに荒ぶられた。

$ gem install knife-solo
uilding native extensions.  This could take a while...
ERROR:  Error installing knife-solo:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating Makefile

make "DESTDIR="
compiling yajl.c
compiling yajl_alloc.c
compiling yajl_buf.c
compiling yajl_encode.c
compiling yajl_ext.c
compiling yajl_gen.c
yajl_gen.c:295:5: warning: implicit conversion from enumeration type 'yajl_gen_state' to different enumeration type 'yajl_gen_status' [-Wenum-conversion]
    DECREMENT_DEPTH;
    ^~~~~~~~~~~~~~~
yajl_gen.c:181:48: note: expanded from macro 'DECREMENT_DEPTH'
    if (--(g->depth) >= YAJL_MAX_DEPTH) return yajl_gen_error;
                                        ~~~~~~ ^~~~~~~~~~~~~~
yajl_gen.c:321:5: warning: implicit conversion from enumeration type 'yajl_gen_state' to different enumeration type 'yajl_gen_status' [-Wenum-conversion]
    DECREMENT_DEPTH;
    ^~~~~~~~~~~~~~~
yajl_gen.c:181:48: note: expanded from macro 'DECREMENT_DEPTH'
    if (--(g->depth) >= YAJL_MAX_DEPTH) return yajl_gen_error;
                                        ~~~~~~ ^~~~~~~~~~~~~~
2 warnings generated.
compiling yajl_lex.c
compiling yajl_parser.c
compiling yajl_version.c
linking shared-object yajl/yajl.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [yajl.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/yajl-ruby-1.2.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/yajl-ruby-1.2.1/ext/yajl/gem_make.out

解決

どうもapple先生んとこのXcode(Mavericks?)で変更になった箇所が出火元らしい。環境変数弄り大丈夫だよ痛くないよって言いながら実行する

$ sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install knife-solo

呪文のようです。

参考

http://2no.hatenablog.com/entry/2014/03/14/061952 http://qiita.com/ysks3n/items/3853426846ccd72c4e3c

はじめrbenv使ってたけどsslエラーが頻発して試しにシステムのデフォ(rbenv global system)に変えたら怒られなくなった。のでそのまま使った。