LoginSignup
2
1

More than 3 years have passed since last update.

bundle install時にffiがコケた

Posted at

起きた問題

業務で開発を行っており、bundle installしようとしたときの話。

Using ...
...(略)
Fetching ffi 1.11.1
Installing ffi 1.11.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /It/is/My Directory/my_project/vendor/bundle/ruby/2.5.0/gems/ffi-1.11.1/ext/ffi_c
/Users/undo/.rbenv/versions/2.5.5/bin/ruby -I
/Users/undo/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0 -r
./siteconf20191220-44496-1pbyg9r.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... 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

current directory: /It/is/My Directory/my_project/vendor/bundle/ruby/2.5.0/gems/ffi-1.11.1/ext/ffi_c
make "DESTDIR=" clean

current directory: /It/is/My Directory/my_project/vendor/bundle/ruby/2.5.0/gems/ffi-1.11.1/ext/ffi_c
make "DESTDIR="
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** ["/It/is/My Directory/my_project] Error 2

make failed, exit code 2

Gem files will remain installed in /It/is/My Directory/my_project/vendor/bundle/ruby/2.5.0/gems/ffi-1.11.1 for inspection.
Results logged to /It/is/My Directory/my_project/vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-18/2.5.0-static/ffi-1.11.1/gem_make.out

An error occurred while installing ffi (1.11.1), and Bundler cannot
continue.
Make sure that `gem install ffi -v '1.11.1'` succeeds before bundling.

In Gemfile:
  *** was resolved to *.*.**, which depends on
    *** was resolved to *.*.*, which depends on
      ohai was resolved to 8.26.1, which depends on
        ffi

bundle installでこける。依存gemのffi関連でこけてるっぽい。
こけてるところを見ると、

/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file

syntax error?
(´ε`;)ウーン…

結論

ffiは空白の入ったディレクトリ名を現在の仕様上許容していないっぽい。
同じ事例がgithubのissueとして上がっていた。
https://github.com/ffi/ffi/issues/623

ディレクトリ名を変更すると問題なくbundle installが進んだ。

2
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1