2016-12-28 20 views
5

cocoapodsをインストールできません。 cocoapodsのインストール中にエラーが発生しました:json-1.8.3以降のエラー

gem install cocoapods 

そして、私はすべてのこれらのエラーを取得::私はこれをやっている

Building native extensions. This could take a while... 
ERROR: Error installing cocoapods: 
    ERROR: Failed to build gem native extension. 

    current directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator 
/usr/local/opt/ruby/bin/ruby -r ./siteconf20161228-19158-1ru87yt.rb extconf.rb 
creating Makefile 

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator 
make "DESTDIR=" clean 

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator 
make "DESTDIR=" 
compiling generator.c 
generator.c:861:25: error: use of undeclared identifier 'rb_cFixnum' 
    } else if (klass == rb_cFixnum) { 
         ^
generator.c:863:25: error: use of undeclared identifier 'rb_cBignum' 
    } else if (klass == rb_cBignum) { 
         ^
generator.c:975:5: warning: division by zero is undefined [-Wdivision-by-zero] 
    rb_scan_args(argc, argv, "01", &opts); 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2143:9: note: expanded from macro 'rb_scan_args' 
     rb_scan_args0(argc,argvp,fmt,\ 
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2329:8: note: expanded from macro 'rb_scan_args0' 
        rb_scan_args_verify(fmt, varc), vars) 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2201:11: note: expanded from macro 'rb_scan_args_verify' 
     verify = rb_scan_args_verify_count(fmt, varc); \ 
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2167:6: note: expanded from macro 'rb_scan_args_count_hash' 
    rb_scan_args_count_block(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2162:6: note: expanded from macro 'rb_scan_args_count_block' 
    rb_scan_args_count_end(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2158:12: note: expanded from macro 'rb_scan_args_count_end' 
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt))) 
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
generator.c:975:5: warning: division by zero is undefined [-Wdivision-by-zero] 
    rb_scan_args(argc, argv, "01", &opts); 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2143:9: note: expanded from macro 'rb_scan_args' 
     rb_scan_args0(argc,argvp,fmt,\ 
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2329:8: note: expanded from macro 'rb_scan_args0' 
        rb_scan_args_verify(fmt, varc), vars) 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2201:11: note: expanded from macro 'rb_scan_args_verify' 
     verify = rb_scan_args_verify_count(fmt, varc); \ 
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2167:6: note: expanded from macro 'rb_scan_args_count_hash' 
    rb_scan_args_count_block(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2163:6: note: expanded from macro 'rb_scan_args_count_block' 
    rb_scan_args_count_end(fmt, ofs+1, varc, vari+1)) 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2158:12: note: expanded from macro 'rb_scan_args_count_end' 
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt))) 
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
generator.c:975:5: warning: division by zero is undefined [-Wdivision-by-zero] 
    rb_scan_args(argc, argv, "01", &opts); 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2143:9: note: expanded from macro 'rb_scan_args' 
     rb_scan_args0(argc,argvp,fmt,\ 
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2329:8: note: expanded from macro 'rb_scan_args0' 
        rb_scan_args_verify(fmt, varc), vars) 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2201:11: note: expanded from macro 'rb_scan_args_verify' 
     verify = rb_scan_args_verify_count(fmt, varc); \ 
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2168:6: note: expanded from macro 'rb_scan_args_count_hash' 
    rb_scan_args_count_block(fmt, ofs+1, varc, vari+1)) 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2162:6: note: expanded from macro 'rb_scan_args_count_block' 
    rb_scan_args_count_end(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2158:12: note: expanded from macro 'rb_scan_args_count_end' 
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt))) 
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
generator.c:975:5: warning: division by zero is undefined [-Wdivision-by-zero] 
    rb_scan_args(argc, argv, "01", &opts); 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2143:9: note: expanded from macro 'rb_scan_args' 
     rb_scan_args0(argc,argvp,fmt,\ 
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2329:8: note: expanded from macro 'rb_scan_args0' 
        rb_scan_args_verify(fmt, varc), vars) 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2201:11: note: expanded from macro 'rb_scan_args_verify' 
     verify = rb_scan_args_verify_count(fmt, varc); \ 
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2167:6: note: expanded from macro 'rb_scan_args_count_hash' 
    rb_scan_args_count_block(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2162:6: note: expanded from macro 'rb_scan_args_count_block' 
    rb_scan_args_count_end(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2158:12: note: expanded from macro 'rb_scan_args_count_end' 
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt))) 
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
generator.c:975:5: warning: division by zero is undefined [-Wdivision-by-zero] 
    rb_scan_args(argc, argv, "01", &opts); 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2143:9: note: expanded from macro 'rb_scan_args' 
     rb_scan_args0(argc,argvp,fmt,\ 
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2329:8: note: expanded from macro 'rb_scan_args0' 
        rb_scan_args_verify(fmt, varc), vars) 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2201:11: note: expanded from macro 'rb_scan_args_verify' 
     verify = rb_scan_args_verify_count(fmt, varc); \ 
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2167:6: note: expanded from macro 'rb_scan_args_count_hash' 
    rb_scan_args_count_block(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2162:6: note: expanded from macro 'rb_scan_args_count_block' 
    rb_scan_args_count_end(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2158:12: note: expanded from macro 'rb_scan_args_count_end' 
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt))) 
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
generator.c:975:5: warning: division by zero is undefined [-Wdivision-by-zero] 
    rb_scan_args(argc, argv, "01", &opts); 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2143:9: note: expanded from macro 'rb_scan_args' 
     rb_scan_args0(argc,argvp,fmt,\ 
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2329:8: note: expanded from macro 'rb_scan_args0' 
        rb_scan_args_verify(fmt, varc), vars) 
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2201:11: note: expanded from macro 'rb_scan_args_verify' 
     verify = rb_scan_args_verify_count(fmt, varc); \ 
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
note: (skipping 5 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2167:6: note: expanded from macro 'rb_scan_args_count_hash' 
    rb_scan_args_count_block(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2162:6: note: expanded from macro 'rb_scan_args_count_block' 
    rb_scan_args_count_end(fmt, ofs, varc, vari) : \ 
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:2158:12: note: expanded from macro 'rb_scan_args_count_end' 
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt))) 
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
6 warnings and 2 errors generated. 
make: *** [generator.o] Error 1 

make failed, exit code 2 

Gem files will remain installed in /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3 for inspection. 
Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0/json-1.8.3/gem_make.out 

私は多くのことを探していると私はこれらのエラーについては何も見つけることができません。

どうすれば解決できますか?

答えて

5

JSON 1.8.3 is not compatible with ruby 2.4.と思われます。彼らは今それを修正していると思います。それと同時に、私は同じ問題をRubyにダウングレードすることで解決しました。2.3

+0

それを'brew switch ruby​​ 2.3.3'(http://stackoverflow.com/a/4158763/1988505)と' sudo gem update --system'(http://stackoverflow.com/a/39775255/1988505)は、私は役に立つと分かった。 –

0

私は同じ問題を抱えていました。私は自分のサイトからCocoapodsアプリをインストールしました。これにより、私は自分のアプリに必要なココアポッドを作成できました(ファイアベースの統合)。コマンドラインツールをインストールする

https://github.com/CocoaPods/CocoaPods/issues/6299#issuecomment-269282062

は私のために働くように見えたが、これは正しく構築されるようにうまくいけば、壊れた依存関係(json1.8.3)が固定されます。

より永続的な解決策が見つかるまで、これが役立つことを望みます。

0
ここ宝石JSONをインストールしようとして 'githubの-ページ'、と

同じ問題..

は、この使用して2.3をルビーにダウングレードすることにより、私の問題を解決:

`醸造インストールrbenv

ルビー構築

rbenvをbashに追加して、端末を開くたびにロードするようにします。 echo 'if which rbenv>/dev/null;次にeval "$(rbenv init - )"; Fiの」>>〜/ .bash_profileの ソース〜/ .bash_profileの

ルビー rbenvから

-V` 2.3.3 rbenvグローバル2.3.3 ルビーをインストールインストールします。場合https://gorails.com/setup/osx/10.12-sierra

関連する問題