ぽんこつメモ

https://github.com/kanorimon

Ruby開発環境構築(Ruby)

gitの設定

# git config --global user.name <username>

# git config --global user.email <email>

rbenvのクローン作成

# git clone git://github.com/sstephenson/rbenv.git ~/.rbenv

ruby-buildのクローン作成

# git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

PATHの設定

# echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

rbenv用shellの初期化を追加

# echo 'eval "$(rbenv init -)"' >> ~/.bash_profile 

shellをリスタート

# exec $SHELL

インストール可能なrubyの一覧

# rbenv install -l

rubyインストール

# rbenv install 1.9.3-p385

デフォルトrubyの設定

# rbenv global 1.9.3-p385

# rbenv rehash

railsインストール

# gem install rdoc

# gem install rails

# rbenv rehash

ファイアウォールの設定(動作確認webrick用3000ポート)

# vi /etc/sysconfig/iptables

# /etc/rc.d/init.d/iptables restart

動作確認

# rails new books -d mysql

# cd books

# vi Gemfile

# rails s