起きたこと
omniauth-twitter gem を入れようとしたら、以下のような感じで怒られる。
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/nomura/repos/tsun-doc/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
/Users/nomura/.rbenv/versions/2.4.0/bin/ruby -r ./siteconf20170103-627-1wq7y31.rb extconf.rb
creating Makefile
current directory: /Users/nomura/repos/tsun-doc/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /Users/nomura/repos/tsun-doc/vendor/bundle/ruby/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);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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,\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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,\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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,\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
/Users/nomura/.rbenv/versions/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))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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,\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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,\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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,\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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)
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nomura/.rbenv/versions/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 /Users/nomura/repos/tsun-doc/vendor/bundle/ruby/2.4.0/gems/json-1.8.3 for inspection.
Results logged to /Users/nomura/repos/tsun-doc/vendor/bundle/ruby/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/json-1.8.3/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
原因
以下の依存により、1系の最新版である 1.8.3 をビルドしようとするが、このバージョンが ruby 2.4.0 に対応していない。
'json', '~> 1.3'
解決策
1.8.5 で解決されたらしいので、 v1.8 ブランチを使えばOK。
gem 'json', github: 'flori/json', branch: 'v1.8'