Ruby on Rails 설치


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get autoremove

apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev # 기본적인 패키지 업데이트

apt-get install git
# git 설치
apt-get install gcc
# gcc 설치
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs
# nodejs 설치
apt-get install python
# python 설치

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
# rbenv & ruby-build 설치
# 환경변수 설정

git clone https://github.com/rbenv/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash rbenv install 2.3.0 rbenv global 2.3.0 ruby -v
gem install bundler
gem install rails -v 4.2.6
rbenv rehash
rails -v echo "gem: --no-ri --no-rdoc" > ~/.gemrc
# gem 도큐먼트 제외