読者です 読者をやめる 読者になる 読者になる

私の歴史と今

読んでて恥ずかしくなるのが私の歴史。だけどそのときは今現在のように真面目に書いていた訳でね。そんな私の今を書いていく。

rbenvの使い方

ruby rbenv mac

使い方をメモ

インストール可能なRubyのバージョンの調べ方

kenmochi-no-MacBook-Pro:repos junya$ rbenv install --list
Available versions:
  1.8.6-p383
  1.8.6-p420
  1.8.7-p249
  1.8.7-p302
  1.8.7-p334
  1.8.7-p352
  1.8.7-p357
  1.8.7-p358
  1.8.7-p370
  1.8.7-p371
  1.9.1-p378
  1.9.2-p180
  1.9.2-p290
  1.9.2-p318
  1.9.2-p320
  1.9.3-dev
  1.9.3-p0
  1.9.3-p125
  1.9.3-p194
  1.9.3-p286
  1.9.3-p327
  1.9.3-p362
  1.9.3-p374
  1.9.3-p385
  1.9.3-p392
  1.9.3-preview1
  1.9.3-rc1
  2.0.0-dev
  2.0.0-p0
  2.0.0-preview1
  2.0.0-preview2
  2.0.0-rc1
  2.0.0-rc2
  2.1.0-dev
  jruby-1.5.6
  jruby-1.6.3
  jruby-1.6.4
  jruby-1.6.5
  jruby-1.6.5.1
  jruby-1.6.6
  jruby-1.6.7
  jruby-1.6.7.2
  jruby-1.6.8
  jruby-1.7.0
  jruby-1.7.0-preview1
  jruby-1.7.0-preview2
  jruby-1.7.0-rc1
  jruby-1.7.0-rc2
  jruby-1.7.1
  jruby-1.7.2
  jruby-1.7.3
  jruby-1.7.4-dev
  maglev-1.0.0
  maglev-1.1.0-dev
  mruby-dev
  rbx-1.2.4
  rbx-2.0.0-dev
  rbx-2.0.0-rc1
  ree-1.8.6-2009.06
  ree-1.8.7-2009.09
  ree-1.8.7-2009.10
  ree-1.8.7-2010.01
  ree-1.8.7-2010.02
  ree-1.8.7-2011.03
  ree-1.8.7-2011.12
  ree-1.8.7-2012.01
  ree-1.8.7-2012.02
  topaz-dev

リストの最新化

kenmochi-no-MacBook-Pro:repos junya$ brew upgrade --HEAD ruby-build
==> Upgrading 1 outdated package, with result:
ruby-build HEAD
==> Upgrading ruby-build
==> Cloning https://github.com/sstephenson/ruby-build.git
Cloning into '/Library/Caches/Homebrew/ruby-build--git'...
remote: Counting objects: 111, done.
remote: Compressing objects: 100% (83/83), done.
remote: Total 111 (delta 45), reused 77 (delta 22)
Receiving objects: 100% (111/111), 30.70 KiB, done.
Resolving deltas: 100% (45/45), done.
==> ./install.sh
🍺  /usr/local/Cellar/ruby-build/HEAD: 83 files, 368K, built in 4 seconds
kenmochi-no-MacBook-Pro:repos junya$ rbenv rehash

インストール済みのRubyのバージョンの調べ方

kenmochi-no-MacBook-Pro:repos junya$ rbenv version
1.9.3-p392 (set by /Users/junya/.rbenv/version)

インストール(2.0.0-p0は失敗)

kenmochi-no-MacBook-Pro:repos junya$ rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/93/2b32qdqn3v76tj1cnf6tmryc0000gn/T/ruby-build.20130801001319.15497
Results logged to /var/folders/93/2b32qdqn3v76tj1cnf6tmryc0000gn/T/ruby-build.20130801001319.15497.log

Last 10 log lines:
installing default gems:      /Users/junya/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
                              bigdecimal 1.2.0
                              io-console 0.4.2
                              json 1.7.7
                              minitest 4.3.2
                              psych 2.0.0
                              rake 0.9.6
                              rdoc 4.0.0
                              test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

インストール(2.0.0-p247は成功)

kenmochi-no-MacBook-Pro:repos junya$ rbenv install 2.0.0-p247
Downloading openssl-1.0.1e.tar.gz...
-> https://www.openssl.org/source/openssl-1.0.1e.tar.gz
Installing openssl-1.0.1e...
Installed openssl-1.0.1e to /Users/junya/.rbenv/versions/2.0.0-p247

Downloading ruby-2.0.0-p247.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
Installing ruby-2.0.0-p247...
Installed ruby-2.0.0-p247 to /Users/junya/.rbenv/versions/2.0.0-p247
kenmochi-no-MacBook-Pro:repos junya$ rbenv rehash