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

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

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

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

Q&A

解決済

2回答

5263閲覧

rbenvでRubyがインストールできない

Nicole_

総合スコア14

Ruby

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

0グッド

0クリップ

投稿2019/07/24 13:22

編集2019/07/24 13:38

この質問の一つ前のエラーを解消するためにいろいろ調査していて、rubyを再インストールしようと思いアンインストール(ruby 2.5.3)→インストール(ruby 2.5.3)時にこけました。

そもそもの発端は
railsにunicornを入れたい

エラー!(この時の状況は前回の質問に書いてます)

いろいろやってみる

ダメ

じゃあunicornをgemから消してとりあえず戻そう(このときgitから変更履歴を辿って前のバージョンに戻す)

bundle update

Fetching nio4r 2.4.0 (was 2.3.1) Installing nio4r 2.4.0 (was 2.3.1) with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/xxxxx/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/nio4r-2.4.0/ext/nio4r /Users/xxxxx/.rbenv/versions/2.5.3/bin/ruby -r ./siteconf20190724-43411-vgqdt9.rb extconf.rb checking for unistd.h... yes checking for sys/select.h... yes checking for port_event_t in poll.h... no checking for sys/epoll.h... no checking for sys/event.h... yes checking for sys/queue.h... yes checking for port_event_t in port.h... no checking for sys/resource.h... yes creating Makefile current directory: /Users/xxxxx/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/nio4r-2.4.0/ext/nio4r make "DESTDIR=" clean make: error: unable to find utility "make", not a developer tool or in PATH current directory: /Users/xxxxx/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/nio4r-2.4.0/ext/nio4r make "DESTDIR=" make: error: unable to find utility "make", not a developer tool or in PATH make failed, exit code 72 Gem files will remain installed in /Users/xxxxx/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/nio4r-2.4.0 for inspection. Results logged to /Users/xxxxx/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/nio4r-2.4.0/gem_make.out An error occurred while installing nio4r (2.4.0), and Bundler cannot continue. Make sure that `gem install nio4r -v '2.4.0' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: rails was resolved to 5.1.7, which depends on actioncable was resolved to 5.1.7, which depends on nio4r


なんで...?

(いろいろ調べる)

rbenvで現在のrubyをアンインストール

rbenvで再インストール

$ rbenv install 2.5.3 ruby-build: use openssl from homebrew Downloading ruby-2.5.3.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.bz2 Installing ruby-2.5.3... BUILD FAILED (OS X 10.14.5 using ruby-build 20181207) Inspect or clean up the working tree at /var/folders/6v/rr3ykmf51cl8_4vxy_ssbp340000gn/T/ruby-build.20190724220108.28652 Results logged to /var/folders/6v/rr3ykmf51cl8_4vxy_ssbp340000gn/T/ruby-build.20190724220108.28652.log Last 10 log lines: checking for setjmp type... _setjmp checking for prefix of external symbols... nm: error: unable to find utility "nm", not a developer tool or in PATH NONE checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking if make is GNU make... make: error: unable to find utility "make", not a developer tool or in PATH no checking for safe null command for make... configure: error: no candidate for safe null command make: error: unable to find utility "make", not a developer tool or in PATH


...

時系列的にはこんな感じになります。

この"make"てなんなんでしょうか...
unicornがいれられない時もでていたエラーなんです...

xcode-select --installはしましたXcodeも入っています...

とにかくrubyが入れられないと何もできないので、たすけてください。
よろしくお願いします。

====== 追記 ======
下記URLを参考に
https://qiita.com/marusho_summers/items/1022d5bbfd2f7856d2f8

echo 'export CC=/usr/bin/gcc' >> ~/.bash_profile source ~./bash_profile

したところ

エラーの内容が

checking for ruby... /Users/shirafujitakuya/.rbenv/shims/ruby checking build system type... x86_64-apple-darwin18.6.0 checking host system type... x86_64-apple-darwin18.6.0 checking target system type... x86_64-apple-darwin18.6.0 gcc: error: unable to find utility "gcc", not a developer tool or in PATH configure: error: clang version 3.0 or later is required make: error: unable to find utility "make", not a developer tool or in PATH

こうなりました...

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

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

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

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

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

guest

回答2

0

結論から言うと、なんとかなりました。(回答してくださった方々ありがとうございます)

不要かもしれませんが、後学の為にやったことと(検討違いかもしれませんが)なぜその事象が起きたかを説明致します。
※直前にした質問の問題についても解決したのでそちらもクローズしておきます。

まず、問題点は2つありました。

①railsにunicornがいれられない
②rbenvからrubyのインストールができない

この2つの問題で吐き出されたエラーの共通点は

make: error: unable to find utility "make", not a developer tool or in PATH

でした。

調べていくうちにmakeはどうやらXcode(かコマンドラインツール)をインストールしたときに自動で使えるようになるらしいとのことに行き着きました。

実は、この作業する直前にXcode消してしまっていました。(全ての原因はこれだと思っています)

再度インストールをし、これで完了かと思いきやまだエラーが出ました。
かなり悩みましたが、binフォルダ内のmake(実行ファイル)を起動させると全てがうまくいきました。
自動で使えるようになるけど、実行ファイル起動しないといけないとは盲点でした....

投稿2019/07/25 08:16

編集2019/07/26 10:10
Nicole_

総合スコア14

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

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

0

ベストアンサー

Mac使ってないんで直接の回答じゃないけど

この"make"てなんなんでしょうか...

make

ターミナルでmakeは起動できるんだろうか?(パスが通ってないとかそういう問題?)

投稿2019/07/24 14:18

gentaro

総合スコア8949

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

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

Nicole_

2019/07/24 14:32

いえいえ回答ありがとうございます!!! $ make make: error: unable to find utility "make", not a developer tool or in PATH $ which make /usr/bin/make $ echo $PATH /usr/bin/make: です...
gentaro

2019/07/24 14:37

そのエラーメッセージでググったら何か解決策は見つかりませんか?
Nicole_

2019/07/25 08:17

自己解決できましたが ``` ターミナルでmakeは起動できるんだろうか? ``` この一言で調査の幅を広げることができました! ベストアンサーとさせていただきます!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問