Mac OS X 10.12.1でrubyのインストールでエラー

[shell]
$ rbenv install 2.3.1
[/shell]

上記バージョンのrubyをインストールしてみようかなと思い、コマンド叩いてみたら、
下記のようなエラーでインストール出来ない問題が起きました。

Downloading ruby-2.3.1.tar.bz2…
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
Installing ruby-2.3.1…

BUILD FAILED (OS X 10.12.1 using ruby-build 20160602)

Inspect or clean up the working tree at /var/folders/mx/9nqgr8w50tn7yddhdqw91zl40000gn/T/ruby-build.20161115215421.2924
Results logged to /var/folders/mx/9nqgr8w50tn7yddhdqw91zl40000gn/T/ruby-build.20161115215421.2924.log

Last 10 log lines:
checking host system type… x86_64-apple-darwin16.1.0
checking target system type… x86_64-apple-darwin16.1.0
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… configure: error: in /var/folders/mx/9nqgr8w50tn7yddhdqw91zl40000gn/T/ruby-build.20161115215421.2924/ruby-2.3.1':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use
–host’.
See `config.log’ for more details
make: *** No targets specified and no makefile found. Stop.

解決するには

[shell]
$ xcode-select –install
[/shell]

のコマンドを叩いて、コマンドラインツールをインストルすればいいみたいです。

これで無事インストールできました。

[shell]
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]
[/shell]

鹿児島県の出水市という所に住んでいまして、インターネット周辺で色々活動して行きたいと思ってるところです。 Webサイト作ったり、サーバ設定したり、プログラムしたりしている、釣りと木工好きなMacユーザです。 今はデータサイエンスに興味を持って競馬AI予想を頑張ってます。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

コメントする

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください