【发布时间】:2019-12-01 01:57:24
【问题描述】:
由于某种原因,我似乎无法安装 Jekyll。 Ruby 已安装,包管理器也已安装,目录的权限应该是固定的,但我似乎仍然无法安装 Jekyll。我在下面附上了一个相当大的代码块,抱歉。这只是我在终端中收到的所有错误消息。
命令“sudo gem install bundler jekyll”每次都失败。
`macs-MBP-2:~ mac$ jekyll -v
-bash: jekyll: command not found
macs-MBP-2:~ mac$ sudo gem install bundler jekyll
Successfully installed bundler-2.0.2
Parsing documentation for bundler-2.0.2
Done installing documentation for bundler after 5 seconds
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.11.1/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20190722-66637-luvw3l.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... yes
checking for ffi_call() in -lffi... yes
checking for ffi_closure_alloc()... no
checking for shlwapi.h... no
checking for rb_thread_call_without_gvl()... yes
checking for ruby_native_thread_p()... yes
checking for ruby_thread_has_gvl_p()... yes
creating extconf.h
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/ffi-1.11.1/mkmf.log
current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.11.1/ext/ffi_c
make "DESTDIR=" clean
current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.11.1/ext/ffi_c
make "DESTDIR="
mkdir -p
Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.11.1 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/ffi-1.11.1/gem_make.out
这里是文件 mkmf.log 中显示错误(15 次)的地方:
conftest.c:13:57: error: use of undeclared identifier 'ruby_thread_has_gvl_p' int t(void) { void ((*volatile p)()); p = (void ((*)()))ruby_thread_has_gvl_p; return !p; } 1 error generated. checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: printf("%p", &t); 9: } 10: 11: return 0; 12: } 13: int t(void) { void ((*volatile p)()); p = (void ((*)()))ruby_thread_has_gvl_p; return !p; –
Also: conftest.c:3:10: fatal error: 'ffi.h' file not found #include <ffi.h> ^~~~~~~ 1 error generated. checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include <ffi.h> /* end */ –
conftest.c:13:57: error: use of undeclared identifier 'ffi_closure_alloc' int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_closure_alloc; return !p; }
【问题讨论】:
-
您是否注意到“要查看为什么此扩展无法编译,请查看 mkmf.log 可以在此处找到:...”的部分?查看它,看看它在哪里显示错误。
-
将这些更新放入您的帖子中,而不是 cmets。
-
这只是摘录;我不认为问题出在
conftest.c,因为配置脚本使用它来确定是否安装了东西。我相信相关错误是您未发布的错误之一。 -
为什么是 sudo?我通常为当前用户设置权限,然后运行
gem install jekyll。