我在 Mac 上安装 sqlite3 版本 1.4.2 时遇到问题。我有一个遗留的 http 服务器应用程序,我正在尝试为其安装依赖项,但捆绑安装在 sqlite3 上一直挂起。 1.3.13 及以下版本可以正常安装,但 1.4.1 及以上版本则不行。
我尝试过使用标记
--with-cflags=-Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types
进行 gem 安装,这对安装程序遇到困难的以前的软件包有帮助,但它没有起作用。 我已经brew安装了sqlite3,但没有任何改善。 我使用的是操作系统为 15.1.1 的 Intel Mac,安装了 xcode 和命令行工具,ruby 2.7.2,sqlite3 -version
给出了 3.48.0。 运行 gem install sqlite3 -v 1.4.2
的(大部分)完整输出如下。 由于帖子大小限制,中间的一些线被剪掉,希望不是问题,因为大多数中间线似乎是重复的。
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
current directory: /Users/fatcullen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sqlite3-1.4.2/ext/sqlite3
/Users/fatcullen/.rbenv/versions/2.7.2/bin/ruby -I /Users/fatcullen/.rbenv/versions/2.7.2/lib/ruby/2.7.0 -r ./siteconf20250118-12176-hparbb.rb extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for -ldl... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for rb_integer_pack()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... yes
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile
current directory: /Users/fatcullen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sqlite3-1.4.2/ext/sqlite3
make "DESTDIR=" clean
current directory: /Users/fatcullen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sqlite3-1.4.2/ext/sqlite3
make "DESTDIR="
compiling aggregator.c
aggregator.c:74:22: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
74 | handler_klass, rb_intern("new"), 0, NULL, &exc_status));
| ^~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
aggregator.c:74:22: note: '{' token is here
74 | handler_klass, rb_intern("new"), 0, NULL, &exc_status));
| ^~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1832 | { \
| ^
aggregator.c:74:22: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
74 | handler_klass, rb_intern("new"), 0, NULL, &exc_status));
| ^~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^
aggregator.c:74:22: note: ')' token is here
74 | handler_klass, rb_intern("new"), 0, NULL, &exc_status));
| ^~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
aggregator.c:141:23: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
141 | handler_instance, rb_intern("step"), argc, params, &exc_status);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
aggregator.c:141:23: note: '{' token is here
141 | handler_instance, rb_intern("step"), argc, params, &exc_status);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1832 | { \
| ^
aggregator.c:141:23: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
141 | handler_instance, rb_intern("step"), argc, params, &exc_status);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^
aggregator.c:141:23: note: ')' token is here
141 | handler_instance, rb_intern("step"), argc, params, &exc_status);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
aggregator.c:159:25: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
159 | handler_instance, rb_intern("finalize"), 0, NULL, &exc_status);
| ^~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
aggregator.c:159:25: note: '{' token is here
159 | handler_instance, rb_intern("finalize"), 0, NULL, &exc_status);
| ^~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1832 | { \
| ^
aggregator.c:159:25: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
159 | handler_instance, rb_intern("finalize"), 0, NULL, &exc_status);
| ^~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^
aggregator.c:159:25: note: ')' token is here
159 | handler_instance, rb_intern("finalize"), 0, NULL, &exc_status);
| ^~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
aggregator.c:219:33: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
219 | if (rb_respond_to(aggregator, rb_intern("arity"))) {
| ^~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
aggregator.c:219:33: note: '{' token is here
219 | if (rb_respond_to(aggregator, rb_intern("arity"))) {
| ^~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1832 | { \
| ^
aggregator.c:219:33: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
219 | if (rb_respond_to(aggregator, rb_intern("arity"))) {
| ^~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^
aggregator.c:219:33: note: ')' token is here
219 | if (rb_respond_to(aggregator, rb_intern("arity"))) {
| ^~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
aggregator.c:220:47: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
220 | VALUE ruby_arity = rb_funcall(aggregator, rb_intern("arity"), 0);
| ^~~~~~~~~~~~~~~~~~
aggregator.c:220:47: note: '{' token is here
220 | VALUE ruby_arity = rb_funcall(aggregator, rb_intern("arity"), 0);
| ^~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1832 | { \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
aggregator.c:220:47: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
220 | VALUE ruby_arity = rb_funcall(aggregator, rb_intern("arity"), 0);
| ^~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
aggregator.c:220:47: note: ')' token is here
220 | VALUE ruby_arity = rb_funcall(aggregator, rb_intern("arity"), 0);
| ^~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
aggregator.c:235:30: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
235 | if (!rb_ivar_defined(self, rb_intern("-aggregators"))) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
aggregator.c:235:30: note: '{' token is here
235 | if (!rb_ivar_defined(self, rb_intern("-aggregators"))) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
database.c:116:21: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
116 | rb_funcall(thing, rb_intern("call"), 1, rb_str_new2(sql));
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^ ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:150:37: note: '{' token is here
150 | VALUE result = rb_funcall(handle, rb_intern("call"), 1, INT2NUM((long)count));
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1832 | { \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:150:37: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
150 | VALUE result = rb_funcall(handle, rb_intern("call"), 1, INT2NUM((long)count));
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:150:37: note: ')' token is here
150 | VALUE result = rb_funcall(handle, rb_intern("call"), 1, INT2NUM((long)count));
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:299:31: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
299 | result = rb_apply(callable, rb_intern("call"), params);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
database.c:299:31: note: '{' token is here
299 | result = rb_apply(callable, rb_intern("call"), params);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1832 | { \
| ^
database.c:299:31: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
299 | result = rb_apply(callable, rb_intern("call"), params);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^
database.c:299:31: note: ')' token is here
299 | result = rb_apply(callable, rb_intern("call"), params);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
database.c:441:39: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
441 | VALUE result = rb_funcall(callback, rb_intern("call"), 5, action, a, b, c, d);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:441:39: note: '{' token is here
441 | VALUE result = rb_funcall(callback, rb_intern("call"), 5, action, a, b, c, d);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1832 | { \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:441:39: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
441 | VALUE result = rb_funcall(callback, rb_intern("call"), 5, action, a, b, c, d);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:441:39: note: ')' token is here
441 | VALUE result = rb_funcall(callback, rb_intern("call"), 5, action, a, b, c, d);
| ^~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:538:39: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
538 | comparison = rb_funcall(comparator, rb_intern("compare"), 2, a_str, b_str);
| ^~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:538:39: note: '{' token is here
538 | comparison = rb_funcall(comparator, rb_intern("compare"), 2, a_str, b_str);
| ^~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1832 | { \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:538:39: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
538 | comparison = rb_funcall(comparator, rb_intern("compare"), 2, a_str, b_str);
| ^~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
1837 | }
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:538:39: note: ')' token is here
538 | comparison = rb_funcall(comparator, rb_intern("compare"), 2, a_str, b_str);
| ^~~~~~~~~~~~~~~~~~~~
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
1847 | __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
| ^
/Users/fatcullen/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2689:27: note: expanded from macro 'rb_funcall'
2689 | rb_funcallv(recv, mid, \
| ^~~
database.c:726:57: error: incompatible function pointer types passing 'int (VALUE, int, char **, char **)' (aka 'int (unsigned long, int, char **, char **)') to parameter of type 'int (*)(void *, int, char **, char **)' [-Wincompatible-function-pointer-types]
726 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), hash_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/sqlite/include/sqlite3.h:430:9: note: passing argument to parameter 'callback' here
430 | int (*callback)(void*,int,char**,char**), /* Callback function */
| ^
database.c:726:81: error: incompatible integer to pointer conversion passing 'VALUE' (aka 'unsigned long') to parameter of type 'void *' [-Wint-conversion]
726 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), hash_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~
/usr/local/opt/sqlite/include/sqlite3.h:431:9: note: passing argument to parameter here
431 | void *, /* 1st argument to callback */
| ^
database.c:728:57: error: incompatible function pointer types passing 'int (VALUE, int, char **, char **)' (aka 'int (unsigned long, int, char **, char **)') to parameter of type 'int (*)(void *, int, char **, char **)' [-Wincompatible-function-pointer-types]
728 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), regular_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/sqlite/include/sqlite3.h:430:9: note: passing argument to parameter 'callback' here
430 | int (*callback)(void*,int,char**,char**), /* Callback function */
| ^
database.c:728:84: error: incompatible integer to pointer conversion passing 'VALUE' (aka 'unsigned long') to parameter of type 'void *' [-Wint-conversion]
728 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), regular_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~
/usr/local/opt/sqlite/include/sqlite3.h:431:9: note: passing argument to parameter here
431 | void *, /* 1st argument to callback */
| ^
11 warnings and 4 errors generated.
make: *** [database.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/fatcullen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sqlite3-1.4.2 for inspection.
Results logged to /Users/fatcullen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-24/2.7.0/sqlite3-1.4.2/gem_make.out
弄清楚了,还有另一个标志需要添加。 在所有警告后面的日志文件深处,有一个整数转换错误,因此添加一个忽略标志解决了这个问题。 完整命令是:
gem install sqlite3 -v 1.4.2 -- --with-cflags="--with-cflags=-g -O0 -std=c11 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion"