LoginSignup
1
3

More than 3 years have passed since last update.

aws EC2でのruby 環境構築

Posted at

aws での ruby on rails 環境構築メモ

  • root ユーザーの切り替え

  • git のインストール

$ sudo su -
# yum -y install git

Rubyに必要なパッケージのインストール

# yum -y install gcc-c++ glibc-headers openssl-devel readline libyaml-devel readline-devel zlib zlib-devel libffi-devel libxml2 libxslt libxml2-devel libxslt-devel sqlite-devel

rbenvのインストール

# git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
# cp -p /etc/profile /etc/profile.ORG
# diff /etc/profile /etc/profile.ORG

# echo 'export RBENV_ROOT="/usr/local/rbenv"' >> /etc/profile
# echo 'export PATH="${RBENV_ROOT}/bin:${PATH}"' >> /etc/profile
# echo 'eval "$(rbenv init -)"' >> /etc/profile

# source /etc/profile

RBENV_ROOT環境変数の有効化やbrent init実行

#su - root

# env | grep RBENV

インストールしたrbenvバージョン確認

#rbenv --version

ruby-buildインストール

# git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build

Rubyのインストール

# rbenv install -l
インストールできるRubyのバージョンを確認

# rbenv install -v 0.0.0 
インストールしたいバージョン 

# rbenv rehash 
インストールしたRubyを使用可能な状態にする

# rbenv global 0.0.0 インストールしたバージョン
デフォルトで使用するRubyの指定

# ruby -v 
インストールしたRubyのバージョンの確認

Railsのインストール

#gem update --system

#gem install nokogiri -- --use-system-libraries

#gem install rails -N

#gem install bundler

#rbenv rehash
1
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
1
3