安装模糊的gem时,我遇到以下问题。
作为参考,我正在使用:RVM 1.29.1红宝石 2.1.7p400导轨 3.2.22.5
我正在尝试安装模糊 1.0.2。
错误:
/Users/jonkeenan/.rvm/rubies/ruby-2.1.7/bin/ruby -r ./siteconf20170525-
62993-1jexk35.rb extconf.rb
creating Makefile
current directory: /Users/jonkeenan/.rvm/gems/ruby-
2.1.7@introhive/gems/blurrily-1.0.2/ext/blurrily
make "DESTDIR=" clean
current directory: /Users/jonkeenan/.rvm/gems/ruby-
2.1.7@introhive/gems/blurrily-1.0.2/ext/blurrily
make "DESTDIR="
compiling map_ext.c
compiling search_tree.c
compiling storage.c
storage.c:283:43: error: taking address of packed member 'refs' of
class or structure 'trigram_map_t' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
if (haystack->refs) blurrily_refs_free(&haystack->refs);
^~~~~~~~~~~~~~
storage.c:405:24: error: taking address of packed member 'refs' of
class or structure 'trigram_map_t' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
blurrily_refs_new(&haystack->refs);
^~~~~~~~~~~~~~
2 errors generated.
make: *** [storage.o] Error 1
make failed, exit code 2
它看起来像一个 c 编译问题,但我不确定。我正在运行一个使用 Apple LLVM 版本 8.1.0 (clang-802.0.42( 的 xcode 版本,如果有帮助的话。
不幸的是,这似乎是一个已知问题,宝石维护者尚未解决。
作为一种解决方法,在上游解决此问题之前,切换到 Vagrant/Docker 开发工作流可能是值得的。