11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【備忘録】mac + homebrew + rbenv環境でRubyのバージョンアップ

Posted at

現時点でのRuby最新バージョンの2.4.2をインストールしようと思ったけどすんなりいかなかったのでメモ

アップデートが必要そうな物を探す

$ brew list

rbenvとruby-buildなるものが入っていたのでこれをアップデートしてみる

$ brew upgrade ruby-build
$ brew upgrade rbenv

これでrbenvのインストール可能バージョン一覧を見てみる

$ rbenv install -l
  ~ 長いので省略 ~
  2.4.0-preview3
  2.4.0-rc1
  2.4.0
  2.4.1
  2.4.2
  2.5.0-dev
  jruby-1.5.6
  jruby-1.6.3
  jruby-1.6.4
  jruby-1.6.5
  ~ 長いので省略 ~

2.4.2ある!

早速インストールしようとするもエラー

$ rbenv install 2.4.2

ruby-build: use openssl from homebrew
Downloading ruby-2.4.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.2.tar.bz2
Installing ruby-2.4.2...
ruby-build: use readline from homebrew

BUILD FAILED (OS X 10.12.6 using ruby-build 20170914)

Inspect or clean up the working tree at /var/folders/hh/p59ptnqj2ql7hkscht2mzk140000gn/T/ruby-build.20170930225056.10580
Results logged to /var/folders/hh/p59ptnqj2ql7hkscht2mzk140000gn/T/ruby-build.20170930225056.10580.log

Last 10 log lines:
Generating RDoc documentation
dyld: lazy symbol binding failed: Symbol not found: _utimensat
  Referenced from: /private/var/folders/hh/p59ptnqj2ql7hkscht2mzk140000gn/T/ruby-build.20170930225056.10580/ruby-2.4.2/./ruby
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _utimensat
  Referenced from: /private/var/folders/hh/p59ptnqj2ql7hkscht2mzk140000gn/T/ruby-build.20170930225056.10580/ruby-2.4.2/./ruby
  Expected in: /usr/lib/libSystem.B.dylib

make: *** [rdoc] Abort trap: 6

xcode-selectをインストールで解決

$ xcode-select --install
$ rbenv install 2.4.2

これでインストール成功

11
8
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?