d0tfi1e’s blog

趣味と日記

EC2でユーザ権限でのrbenvインストール

$ sudo yum update -y
$ sudo yum groupinstall "Development Tools" -y

言語を変えておきます(rbenvのインストールに直接影響はないですが、日本語とか文字化けするので)。

$ sudo vim /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ cd ~/.rbenv/plugins/ruby-build
$ sudo ./install.sh
$ sudo yum install -y openssl-devel readline-devel
$ rbenv install 2.4.2
$ rbenv global 2.4.2