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

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

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

Terminalは、Apple社のmacOSに標準で付属しているUNIX端末エミュレータ。UNIXコマンドによってMacの操作および設定を行うことができます。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Ruby on Rails

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

Q&A

解決済

1回答

1723閲覧

Railsで bundle install ができない

Shmupeiii

総合スコア105

terminal

Terminalは、Apple社のmacOSに標準で付属しているUNIX端末エミュレータ。UNIXコマンドによってMacの操作および設定を行うことができます。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Ruby on Rails

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

0グッド

0クリップ

投稿2021/09/27 15:17

前提・実現したいこと

ここに質問の内容を詳しく書いてください。

Ruby on rails の環境構築中に、bundle installができずに困っています。
その影響で、rails new myappもエラーが発生している状況です。
よろしくお願いいたします。

発生している問題・エラーメッセージ

To see why this extension failed to compile, please check the mkmf.log which can be found here: /Users/abeshmupeii/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/racc-1.5.2/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /Users/abeshmupeii/vendor/bundle/ruby/2.6.0/gems/racc-1.5.2 for inspection. Results logged to /Users/abeshmupeii/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/racc-1.5.2/gem_make.out An error occurred while installing racc (1.5.2), and Bundler cannot continue. Make sure that `gem install racc -v '1.5.2' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: rails was resolved to 6.1.4.1, which depends on actioncable was resolved to 6.1.4.1, which depends on actionpack was resolved to 6.1.4.1, which depends on actionview was resolved to 6.1.4.1, which depends on rails-dom-testing was resolved to 2.0.3, which depends on nokogiri was resolved to 1.12.4, which depends on racc

該当のソースコード

terminal

1(base) abeshmupeii@ABemcp ~ % sudo bundle install 2Password: 3Don't run Bundler as root. Bundler can ask for sudo if it is needed, and 4installing your bundle as root will break this application for all non-root 5users on this machine. 6Ignoring nio4r-2.5.8 because its extensions are not built. Try: gem pristine nio4r --version 2.5.8 7Ignoring websocket-driver-0.7.5 because its extensions are not built. Try: gem pristine websocket-driver --version 0.7.5 8Fetching gem metadata from https://rubygems.org/............ 9Using rake 13.0.6 10Using concurrent-ruby 1.1.9 11Using i18n 1.8.10 12Using minitest 5.14.4 13Using tzinfo 2.0.4 14Using zeitwerk 2.4.2 15Using activesupport 6.1.4.1 16Using builder 3.2.4 17Using erubi 1.10.0 18Using mini_portile2 2.6.1 19Fetching racc 1.5.2 20Installing racc 1.5.2 with native extensions 21Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 22 23current directory: 24/Users/abeshmupeii/vendor/bundle/ruby/2.6.0/gems/racc-1.5.2/ext/racc/cparse 25/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I 26/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r 27./siteconf20210928-25986-gzy1fy.rb extconf.rb 28checking for rb_ary_subseq()... *** extconf.rb failed *** 29Could not create Makefile due to some reason, probably lack of necessary 30libraries and/or headers. Check the mkmf.log file for more details. You may 31need configuration options. 32 33Provided configuration options: 34 --with-opt-dir 35 --without-opt-dir 36 --with-opt-include 37 --without-opt-include=${opt-dir}/include 38 --with-opt-lib 39 --without-opt-lib=${opt-dir}/lib 40 --with-make-prog 41 --without-make-prog 42 --srcdir=. 43 --curdir 44--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME) 45/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in 46`try_do': The compiler failed to generate an executable file. (RuntimeError) 47You have to install development tools first. 48from 49/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:546:in 50`block in try_link0' 51from 52/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in 53`mktmpdir' 54from 55/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:in 56`try_link0' 57from 58/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:570:in 59`try_link' 60from 61/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:782:in 62`try_func' 63from 64/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1069:in 65`block in have_func' 66from 67/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in 68`block in checking_for' 69from 70/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in 71`block (2 levels) in postpone' 72from 73/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in 74`open' 75from 76/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in 77`block in postpone' 78from 79/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in 80`open' 81from 82/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in 83`postpone' 84from 85/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in 86`checking_for' 87from 88/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1068:in 89`have_func' 90 from extconf.rb:6:in `<main>' 91 92To see why this extension failed to compile, please check the mkmf.log which can 93be found here: 94 95/Users/abeshmupeii/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/racc-1.5.2/mkmf.log 96 97extconf failed, exit code 1 98 99Gem files will remain installed in 100/Users/abeshmupeii/vendor/bundle/ruby/2.6.0/gems/racc-1.5.2 for inspection. 101Results logged to 102/Users/abeshmupeii/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/racc-1.5.2/gem_make.out 103 104An error occurred while installing racc (1.5.2), and Bundler cannot 105continue. 106Make sure that `gem install racc -v '1.5.2' --source 'https://rubygems.org/'` 107succeeds before bundling. 108 109In Gemfile: 110 rails was resolved to 6.1.4.1, which depends on 111 actioncable was resolved to 6.1.4.1, which depends on 112 actionpack was resolved to 6.1.4.1, which depends on 113 actionview was resolved to 6.1.4.1, which depends on 114 rails-dom-testing was resolved to 2.0.3, which depends on 115 nokogiri was resolved to 1.12.4, which depends on 116 racc 117

試したこと

他のサイトを見ても良い情報が出てきませんでした。

補足情報(FW/ツールのバージョンなど)

Ruby on rails 5.2.1
ruby ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
OS: macOS

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

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

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

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

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

guest

回答1

0

ベストアンサー

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

とありますように、mkmf.logを見てください。そこになぜ失敗したかが書かれています。多くの場合、どうしたらよいかのヒントも書かれています。
大抵はなにか File が足りないということが原因です。

Results logged to
/Users/abeshmupeii/vendor/bundle/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/racc-1.5.2/gem_make.out

ともあるのでそこも見ておくと良いでしょう

投稿2021/09/28 10:50

winterboum

総合スコア23416

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問