○ 困っていること
Everyday Railsのセットアップをしようと思って、https://github.com/everydayrails/everydayrails-rspec-2017 をローカル環境へgit clone をして、bundle install をしたところ ffi がインストールできないというエラーに突き当たりました。
詳しい方がいましたらご教授いただけると幸いです。
bundle installを実行すると以下のようなメッセージが表示されます。
Fetching ffi 1.9.18 Installing ffi 1.9.18 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/gems/ffi-1.9.18/ext/ffi_c /Users/NAME/.rbenv/versions/2.4.9/bin/ruby -r ./siteconf20201029-20645-s8fch7.rb extconf.rb checking for ffi_call() in -lffi... yes checking for ffi_prep_closure()... yes checking for ffi_raw_call()... yes checking for ffi_prep_raw_closure()... yes checking for shlwapi.h... no checking for rb_thread_blocking_region()... no checking for rb_thread_call_with_gvl()... yes checking for rb_thread_call_without_gvl()... yes checking for ffi_prep_cif_var()... yes creating extconf.h creating Makefile current directory: /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/gems/ffi-1.9.18/ext/ffi_c make "DESTDIR=" clean current directory: /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/gems/ffi-1.9.18/ext/ffi_c make "DESTDIR=" compiling AbstractMemory.c compiling ArrayType.c compiling Buffer.c compiling Call.c Call.c:355:5: error: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Werror,-Wimplicit-function-declaration] rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL); ^ ./Thread.h:78:39: note: expanded from macro 'rbffi_thread_blocking_region' # define rbffi_thread_blocking_region rb_thread_call_without_gvl ^ 1 error generated. make: *** [Call.o] Error 1 make failed, exit code 2 Gem files will remain installed in /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/gems/ffi-1.9.18 for inspection. Results logged to /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-19/2.4.0/ffi-1.9.18/gem_make.out An error occurred while installing ffi (1.9.18), and Bundler cannot continue. Make sure that `gem install ffi -v '1.9.18' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: selenium-webdriver was resolved to 3.6.0, which depends on childprocess was resolved to 0.8.0, which depends on ffi
エラーメッセージに従って gem install ffi -v '1.9.18' --source 'https://rubygems.org/' を実行したところ以下のようなメッセージが表示されました。
Building native extensions. This could take a while... ERROR: Error installing ffi: ERROR: Failed to build gem native extension. current directory: /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/gems/ffi-1.9.18/ext/ffi_c /Users/NAME/.rbenv/versions/2.4.9/bin/ruby -r ./siteconf20201029-20814-pjw89c.rb extconf.rb checking for ffi_call() in -lffi... yes checking for ffi_prep_closure()... yes checking for ffi_raw_call()... yes checking for ffi_prep_raw_closure()... yes checking for shlwapi.h... no checking for rb_thread_blocking_region()... no checking for rb_thread_call_with_gvl()... yes checking for rb_thread_call_without_gvl()... yes checking for ffi_prep_cif_var()... yes creating extconf.h creating Makefile current directory: /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/gems/ffi-1.9.18/ext/ffi_c make "DESTDIR=" clean current directory: /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/gems/ffi-1.9.18/ext/ffi_c make "DESTDIR=" compiling AbstractMemory.c compiling ArrayType.c compiling Buffer.c compiling Call.c Call.c:355:5: error: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Werror,-Wimplicit-function-declaration] rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL); ^ ./Thread.h:78:39: note: expanded from macro 'rbffi_thread_blocking_region' # define rbffi_thread_blocking_region rb_thread_call_without_gvl ^ 1 error generated. make: *** [Call.o] Error 1 make failed, exit code 2 Gem files will remain installed in /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/gems/ffi-1.9.18 for inspection. Results logged to /Users/NAME/.rbenv/versions/2.4.9/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-19/2.4.0/ffi-1.9.18/gem_make.out
○ 試したこと
Mac で Gem の native extension のビルドでエラーしてハマった時のメモを参考にしたが、xcodeもgccもすでにインストールされていた。
○ 環境
$ ruby -v ruby 2.4.9p362 (2019-10-02 revision 67824) [x86_64-darwin19]
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。