質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

3527閲覧

rails newを実行すると、Gem::Ext::BuildError: ERROR: Failed to build gem native extension.がでる。

退会済みユーザー

退会済みユーザー

総合スコア0

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2018/02/22 10:14

rails newを実行するとGem::Ext::BuildError: ERROR: Failed to build gem native extension.がでてしまいます。

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c /Users/yoshinori/.rbenv/versions/2.5.0-dev/bin/ruby -r ./siteconf20180222-38898-1fxclyt.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_blocking_region()... no checking for rb_thread_call_with_gvl()... yes checking for rb_thread_call_without_gvl()... yes creating extconf.h creating Makefile current directory: /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c make "DESTDIR=" clean current directory: /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c make "DESTDIR=" Running autoreconf for libffi autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 configure.ac:376: warning: AC_PROG_LD is m4_require'd but not m4_defun'd acinclude.m4:333: LIBFFI_CHECK_LINKER_FEATURES is expanded from... acinclude.m4:473: LIBFFI_ENABLE_SYMVERS is expanded from... configure.ac:376: the top level configure.ac:376: warning: AC_PROG_LD is m4_require'd but not m4_defun'd acinclude.m4:333: LIBFFI_CHECK_LINKER_FEATURES is expanded from... acinclude.m4:473: LIBFFI_ENABLE_SYMVERS is expanded from... configure.ac:376: the top level autoreconf: configure.ac: tracing configure.ac:376: warning: AC_PROG_LD is m4_require'd but not m4_defun'd acinclude.m4:333: LIBFFI_CHECK_LINKER_FEATURES is expanded from... acinclude.m4:473: LIBFFI_ENABLE_SYMVERS is expanded from... configure.ac:376: the top level autoreconf: configure.ac: not using Libtool autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf --force configure.ac:376: warning: AC_PROG_LD is m4_require'd but not m4_defun'd acinclude.m4:333: LIBFFI_CHECK_LINKER_FEATURES is expanded from... acinclude.m4:473: LIBFFI_ENABLE_SYMVERS is expanded from... configure.ac:376: the top level configure.ac:41: error: possibly undefined macro: AC_PROG_LIBTOOL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure:7612: error: possibly undefined macro: AC_PROG_LD autoreconf: /usr/local/Cellar/autoconf/2.69/bin/autoconf failed with exit status: 1 make: *** ["/Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-darwin16"/.libs/libffi_convenience.a] Error 1 make failed, exit code 2 Gem files will remain installed in /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21 for inspection. Results logged to /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/ffi-1.9.21/gem_make.out An error occurred while installing ffi (1.9.21), and Bundler cannot continue. Make sure that `gem install ffi -v '1.9.21'` succeeds before bundling. In Gemfile: selenium-webdriver was resolved to 3.9.0, which depends on childprocess was resolved to 0.8.0, which depends on ffi run bundle exec spring binstub --all * bin/rake: spring inserted * bin/rails: spring inserted ```An error occurred while installing ffi (1.9.21), and Bundler cannot continue. Make sure that `gem install ffi -v '1.9.21'` succeeds before bundling.と書いてあったので、gem install ffi -v '1.9.21'を実行したのですが、またエラーがでました。

Building native extensions. This could take a while...
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.

current directory: /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c

/Users/yoshinori/.rbenv/versions/2.5.0-dev/bin/ruby -r ./siteconf20180222-39138-1mleso5.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_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
creating extconf.h
creating Makefile

current directory: /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR=" clean

current directory: /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR="
Running autoreconf for libffi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
configure.ac:376: warning: AC_PROG_LD is m4_require'd but not m4_defun'd
acinclude.m4:333: LIBFFI_CHECK_LINKER_FEATURES is expanded from...
acinclude.m4:473: LIBFFI_ENABLE_SYMVERS is expanded from...
configure.ac:376: the top level
configure.ac:376: warning: AC_PROG_LD is m4_require'd but not m4_defun'd
acinclude.m4:333: LIBFFI_CHECK_LINKER_FEATURES is expanded from...
acinclude.m4:473: LIBFFI_ENABLE_SYMVERS is expanded from...
configure.ac:376: the top level
autoreconf: configure.ac: tracing
configure.ac:376: warning: AC_PROG_LD is m4_require'd but not m4_defun'd
acinclude.m4:333: LIBFFI_CHECK_LINKER_FEATURES is expanded from...
acinclude.m4:473: LIBFFI_ENABLE_SYMVERS is expanded from...
configure.ac:376: the top level
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf --force
configure.ac:376: warning: AC_PROG_LD is m4_require'd but not m4_defun'd
acinclude.m4:333: LIBFFI_CHECK_LINKER_FEATURES is expanded from...
acinclude.m4:473: LIBFFI_ENABLE_SYMVERS is expanded from...
configure.ac:376: the top level
configure.ac:41: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure:7612: error: possibly undefined macro: AC_PROG_LD
autoreconf: /usr/local/Cellar/autoconf/2.69/bin/autoconf failed with exit status: 1
make: *** ["/Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-darwin16"/.libs/libffi_convenience.a] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/gems/ffi-1.9.21 for inspection.
Results logged to /Users/yoshinori/.rbenv/versions/2.5.0-dev/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/ffi-1.9.21/gem_make.out

もう何が何だかさっぱりです。どなたかご教授お願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

ffi 1.9.21の互換性があまりよくなかったぽい。。
1.9.21以下のバージョンでインストールを試みたらうまくいった。

投稿2018/02/22 12:54

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問