Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gistee/f71654cfaf14c0de73ebe65264cc296d to your computer and use it in GitHub Desktop.
Save gistee/f71654cfaf14c0de73ebe65264cc296d to your computer and use it in GitHub Desktop.
# ubuntu 16.04 서버에서 ruby 설치
sudo apt-get update
# ruby와 rbenv 설치를 위한 의존성 패키지 설치
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev -y
# rails app 생성을 위한 nodejs, sqlite3 설치
sudo apt-get install nodejs libsqlite3-dev -y
# superuser 권한없이 rails를 사용하기 위한 rbenv 설치
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
# rbenv install 사용을 위한 ruby-build 플로그인 설치
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
# rbev를 이용한 ruby 설치
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
# gem을 이용한 bundler와 rails 설치
echo "gem: --no-document" > ~/.gemrc
gem install bundler
gem install rails
rbenv rehash
rails -v
# rails를 이용한 blog app 만들기
rails new blog
# 생성된 blog app에서 welcome controller와 index action 만들기
cd blog;
./bin/rails generate controller Welcome index
# rails 서버 구동
./bin/rails server
# rails 서버의 정상 구동 여부를 웹브라우를 실행하여 아래의 주소에서 확인
http://<external-server-ip>:3000
http://<external-server-ip>:3000/welcome/index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment