Trouble installing/running on OS X 10.13

Hi, I’m having trouble building the native extensions when installing as a normal user. I can install Jekyll as sudo, but it fails to run if I do.

I have included some of my config and the error message below.

You can see, my ruby path, my $PATH, the results of gem install bundler jekyll, the results of sudo gem install jekyll, and me trying to run jekyll new.

If you have additional questions, let me know.

Any advice?
Thanks for your time.

   ✘  ~  which ruby
/usr/bin/ruby
 ~  echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/Applications/Wireshark.app/Contents/MacOS:/Users/john/bin:/Users/john/.local/lib/aws/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local/Cellar/opencv/2.4.13.1/bin:/usr/local/opt/mongodb@3.4/bin:/Users/john/.gem/ruby/2.3.0/bin:/Users/john/Library/Android/sdk/platform-tools/
 ~  gem install bundler jekyll
Successfully installed bundler-1.17.2
Parsing documentation for bundler-1.17.2
Done installing documentation for bundler after 4 seconds
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
	ERROR: Failed to build gem native extension.

    current directory: /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20181212-58206-ghvs7e.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 ffi_raw_call()... no
checking for shlwapi.h... no
checking for ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
creating extconf.h
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/john/.gem/extensions/universal-darwin-17/2.3.0/ffi-1.9.25/mkmf.log

current directory: /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c
make "DESTDIR=" clean

current directory: /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c
make "DESTDIR="
mkdir -p "/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c"/libffi-i386; (if [ ! -f "/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi"/configure ]; then echo "Running autoreconf for libffi"; cd "/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi" && /bin/sh /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/autogen.sh > /dev/null; fi); (if [ ! -f "/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c"/libffi-i386 && env CC=" xcrun clang" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --disable-docs --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 /Applications/Xcode.app/Contents/Developer/usr/bin/make -C "/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c"/libffi-i386
Configuring libffi for i386
clang: error: unsupported option '-print-multi-os-directory'
clang: error: no input files
/Applications/Xcode.app/Contents/Developer/usr/bin/make 'AR_FLAGS=' 'CC_FOR_BUILD=' 'CFLAGS=-arch i386  -Wall -fexceptions' 'CXXFLAGS=-g -O2' 'CFLAGS_FOR_BUILD=' 'CFLAGS_FOR_TARGET=' 'INSTALL=/usr/bin/install -c' 'INSTALL_DATA=/usr/bin/install -c -m 644' 'INSTALL_PROGRAM=/usr/bin/install -c' 'INSTALL_SCRIPT=/usr/bin/install -c' 'JC1FLAGS=' 'LDFLAGS=-arch i386' 'LIBCFLAGS=' 'LIBCFLAGS_FOR_TARGET=' 'MAKE=/Applications/Xcode.app/Contents/Developer/usr/bin/make' 'MAKEINFO=/bin/sh /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/missing makeinfo ' 'PICFLAG=' 'PICFLAG_FOR_TARGET=' 'RUNTESTFLAGS=' 'SHELL=/bin/sh' 'exec_prefix=/usr/local' 'infodir=/usr/local/share/info' 'libdir=/usr/local/lib' 'mandir=/usr/local/share/man' 'prefix=/usr/local' 'AR=ar' 'AS=as' 'CC=xcrun clang' 'CXX=g++' 'LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld' 'NM=nm' 'RANLIB=ranlib' 'DESTDIR=' all-recursive
Making all in include
make[3]: Nothing to be done for `all'.
Making all in testsuite
make[3]: Nothing to be done for `all'.
Making all in man
make[3]: Nothing to be done for `all'.
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi  -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/prep_cif.lo /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/prep_cif.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/prep_cif.c  -fno-common -DPIC -o src/.libs/prep_cif.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi  -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/types.lo /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/types.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/types.c  -fno-common -DPIC -o src/.libs/types.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi  -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/raw_api.lo /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/raw_api.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/raw_api.c  -fno-common -DPIC -o src/.libs/raw_api.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi  -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/java_raw_api.lo /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/java_raw_api.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/java_raw_api.c  -fno-common -DPIC -o src/.libs/java_raw_api.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi  -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/closures.lo /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/closures.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/closures.c  -fno-common -DPIC -o src/.libs/closures.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi  -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/x86/ffi.lo /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/ffi.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/ffi.c  -fno-common -DPIC -o src/x86/.libs/ffi.o
/bin/sh ./libtool    --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi  -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src  -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch i386  -c -o src/x86/sysv.lo /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/sysv.S
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src -I. -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch i386 -c /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/sysv.S  -fno-common -DPIC -o src/x86/.libs/sysv.o
/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/sysv.S:808:11: warning: section "__textcoal_nt" is deprecated
 .section __TEXT,__textcoal_nt,coalesced,pure_instructions; .weak_definition ___x86.get_pc_thunk.bx; .private_extern ___x86.get_pc_thunk.bx
          ^      ~~~~~~~~~~~~~
/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/sysv.S:808:11: note: change section name to "__text"
 .section __TEXT,__textcoal_nt,coalesced,pure_instructions; .weak_definition ___x86.get_pc_thunk.bx; .private_extern ___x86.get_pc_thunk.bx
          ^      ~~~~~~~~~~~~~
/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/sysv.S:814:11: warning: section "__textcoal_nt" is deprecated
 .section __TEXT,__textcoal_nt,coalesced,pure_instructions; .weak_definition ___x86.get_pc_thunk.dx; .private_extern ___x86.get_pc_thunk.dx
          ^      ~~~~~~~~~~~~~
/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/sysv.S:814:11: note: change section name to "__text"
 .section __TEXT,__textcoal_nt,coalesced,pure_instructions; .weak_definition ___x86.get_pc_thunk.dx; .private_extern ___x86.get_pc_thunk.dx
          ^      ~~~~~~~~~~~~~
/bin/sh ./libtool  --tag=CC   --mode=link xcrun clang  -arch i386  -Wall -fexceptions  -arch i386 -o libffi_convenience.la  src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo   src/x86/ffi.lo src/x86/sysv.lo
libtool: link: ar cru .libs/libffi_convenience.a src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/sysv.o
libtool: link: ranlib .libs/libffi_convenience.a
libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
/bin/sh ./libtool  --tag=CC   --mode=link xcrun clang  -arch i386  -Wall -fexceptions -no-undefined -version-info `grep -v '^#' /Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c/libffi/libtool-version`   '-arch' 'i386'  -arch i386 -o libffi.la -rpath /usr/local/lib src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo  src/x86/ffi.lo src/x86/sysv.lo
libtool: link:  xcrun clang -dynamiclib  -o .libs/libffi.7.dylib  src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/sysv.o    -arch i386 -arch i386 -arch i386   -install_name  /usr/local/lib/libffi.7.dylib -compatibility_version 9 -current_version 9.0 -Wl,-single_module
ld: library not found for -ldylib1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libffi.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** ["/Users/john/.gem/gems/ffi-1.9.25/ext/ffi_c"/libffi-i386/.libs/libffi_convenience.a] Error 2

make failed, exit code 2

Gem files will remain installed in /Users/john/.gem/gems/ffi-1.9.25 for inspection.
Results logged to /Users/john/.gem/extensions/universal-darwin-17/2.3.0/ffi-1.9.25/gem_make.out
1 gem installed
 ✘  ~   sudo gem install jekyll
Fetching: jekyll-3.8.5.gem (100%)
Successfully installed jekyll-3.8.5
Parsing documentation for jekyll-3.8.5
Installing ri documentation for jekyll-3.8.5
Done installing documentation for jekyll after 2 seconds
1 gem installed
 ~  jekyll new
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:241:in `bin_path': can't find gem jekyll (>= 0.a) (Gem::GemNotFoundException)
	from /usr/local/bin/jekyll:22:in `<main>'

I was able to solve my issues using details from this thread:

1 Like

It is because of the issue #607.
Can be solved by this #611