4
3

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.

anyenvをmacにインストールしてみる

Posted at

##概要
anyenvとはrubyの環境をシステムに入っているのを汚さずに環境を作れるもの。
新しくrubyを入れるための作業。

anyenv versionsして

  system
* 2.1.1 (set by /Users/XXX/.anyenv/envs/rbenv/version)

が表示されれば成功。

##これを参考に、インスールを進めてみる
http://qiita.com/luckypool/items/f1e756e9d3e9786ad9ea

結果
$ git clone https://github.com/riywo/anyenv ~/.anyenv
Cloning into '/Users/kenji/.anyenv'...
remote: Reusing existing pack: 104, done.
remote: Total 104 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (104/104), 17.41 KiB | 0 bytes/s, done.
Resolving deltas: 100% (36/36), done.
Checking connectivity... done.

##インストール出来たか、確認

結果
$ anyenv versions
-bash: anyenv: command not found

インストールされていないっぽい。

##先生曰く、pathが通っていないらしく、言われるがままにコマンドを売っていく

結果
$ echo $PATH
/Users/kenji/.anyenv/envs/rbenv/bin:/Users/kenji/.anyenv/envs/rbenv/shims:/Users/kenji/.anyenv/bin:/Users/kenji/.anyenv/bin:/Users/kenji/.anyenv/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/opt/local/bin:/opt/local/sbin
結果
$ echo env
env
結果
$ env
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/c_/czkgjt514bq2z0wcjhmxrxbw0000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-0jYyEa/Render
TERM_PROGRAM_VERSION=326
TERM_SESSION_ID=45CA8B07-8A28-419A-BD90-AB785A07C151
USER=kenji
RBENV_ROOT=/Users/kenji/.anyenv/envs/rbenv
SSH_AUTH_SOCK=/tmp/launch-e7Z5sU/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:1:14
__CHECKFIX1436934=1
PATH=/Users/kenji/.anyenv/envs/rbenv/bin:/Users/kenji/.anyenv/envs/rbenv/shims:/Users/kenji/.anyenv/bin:/Users/kenji/.anyenv/bin:/Users/kenji/.anyenv/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/opt/local/bin:/opt/local/sbin
PWD=/Users/kenji
LANG=ja_JP.UTF-8
RBENV_SHELL=bash
HOME=/Users/kenji
SHLVL=1
LOGNAME=kenji
_=/usr/bin/env
結果
$ echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(anyenv init -)"' >> ~/.bashrc
$ cat ~/.bashrc

alias ll='ls -la'
export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init -)"

いい感じらしい。
なので確認してみる。↓

結果
$ echo $PATH
/Users/kenji/.anyenv/envs/rbenv/bin:/Users/kenji/.anyenv/bin:/Users/kenji/.anyenv/envs/rbenv/bin:/Users/kenji/.anyenv/envs/rbenv/shims:/Users/kenji/.anyenv/bin:/Users/kenji/.anyenv/bin:/Users/kenji/.anyenv/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/opt/local/bin:/opt/local/sbin
結果
$ which anyenv
/Users/kenji/.anyenv/bin/anyenv
結果
$  ll ~/.anyenv/envs
total 0
drwxr-xr-x  3 kenji  staff  102  4  7 22:57 .
drwxr-xr-x  10 kenji  staff  340  4  7 22:55 ..
drwxr-xr-x  12 kenji  staff  408  4  7 22:57 rbenv

インストールされてるか確認してみる

結果
$ which rbenv
/Users/kenji/.anyenv/envs/rbenv/bin/rbenv
結果
$ which gem
/Users/kenji/.anyenv/envs/rbenv/shims/gem
結果
$ anyenv versions
rbenv:
* system (set by /Users/kenji/.anyenv/envs/rbenv/version)
  2.1.1

インストール成功してるっぽい!!!!!

感想

CUIの黒い画面で操作していると ちゃんとインストールとか設定できているのかわかりにくいので、確認のコマンドをちょこちょこ実行して、確認しつつ作業することが多いらしい。

全く理解してないけど、自力で?システムをインストール出来た達成感がある。しかも黒い画面で。。。

先生、ありがとうございました。

4
3
0

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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?