8
4

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 3 years have passed since last update.

anyenvでrubyの環境構築

Last updated at Posted at 2020-02-09

anyenvでrubyをセットアップしたときのメモです。

インストール

#インストール
$ brew install anyenv 
$ anyenv install --init
$ code ~/.bash_profile

設定

.bash_profileに以下を追加

# anyenv
export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init -)"

追加内容を反映する

$ source ~/.bash_profile

動作確認

anyenv install -l はこのanyenvインストールできる*envの一覧を表示するコマンド

$ anyenv install -l
  Renv
  crenv
  denv
  erlenv
  exenv
  goenv
  hsenv
  jenv
  luaenv
  nodenv
  phpenv
  plenv
  pyenv
  rbenv
  sbtenv
  scalaenv
  swiftenv
  tfenv

anyenvでrbenvを入れる

$ anyenv install rbenv
$ source .bash_profile
$ rbenv install -l
1.8.5-p52
1.8.5-p113
1.8.5-p114
1.8.5-p115
1.8.5-p231
1.8.6
1.8.6-p36
...

rubyをinstall

今回は、バージョン 2.7.0 を入れます。

$ rbenv install 2.7.0
$ rbenv global 2.7.0
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
8
4
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
8
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?