modify 6

Gemfile, Gem = 루비 라이브러리 설치 및 사용

rails new myapp(프로젝트 이름) 위 명령어로 레일즈 프로젝트를 생성하면 Gemfile이 생성되는 것을 확인할 수 있는데 간단하게 설명하자면 Gem은 Ruby 라이브러리고 Gemfile은 다양한 Gem을 등록하는 파일이며, 우리는 그냥 Gemfile에 Gem들을 등록해 사용하기만 하면 된다. 1. Bundler 설치하기 먼저 올바른 Gem을 사용하고 관리할 수 있도록, 의존성 관리를 위해 Bundler를 설치한다. gem install bundler rbenv rehash 2. Gem, Gemfile에 추가하기 cd myapp vi Gemfile gem 'bootstrap-sass', '~>3.3.6' 3. 젬 설치하기 Gemfile에 Gem을 등록하고, 아래 명령을 실행한다. cd myapp..

modify 2018.11.27

Ubuntu 16.04 Rails 설치

1. Rails 설치 Rails는 상당히 많은 프로그램에 의존하기 때문에 NodeJS와 같은 JS runtime을 설치해야 합니다. sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs gem install rails rails 설치 2. 새로운 환경으로 재설정 rbenv rehash 3. 설치 확인 rails -v 위 명령어로 버전을 확인하면 설치되었는지 알 수 있습니다. 참고 https://rorlab.gitbooks.io/railsguidebook/content/contents/rails/linux_install.html

modify 2018.11.27

Ubuntu 16.04 Rbenv로 Ruby 설치

1. rbenv의 플러그인 ruby-build 설치 Rbenv를 이용해서 ruby를 설치하려면, rbenv의 플러그인 ruby-build가 필요하다. mkdir -p ~/.rbenv/plugins git clone git://github.com/ssetephenson/ruby-build.git github에서 rbenv를 받아온다. 2. 종속성 설치 후 Ruby 설치 Ruby 설치를 위해 필요한 라이브러리 등을 우선 설치합니다. sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev git-core curl build-essential libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libcurl4-openssl-..

modify 2018.11.27

Ubuntu 16.04 Rbenv 설치

레일스 공식 웹사이트에서는 rbenv를 이용하여 루비를 설치할 것을 권고하고 있다. 1. rbenv 설치 cd ~ git clone git://github.com/sstephenson/rbenv.git .rbenv github에서 rbenv를 받아온다. 위 명령어를 치면 .rbenv라는 디렉토리가 생성되고 그 안에 소스코드가 설치된 것을 볼 수 있다. 2. rbenv 명령어를 실행할 수 있도록 환경 변수를 등록해준다. vi ~/.profile vi ~/.bashrc 마지막에 위 소스 추가 3. 변경 내용 적용 source .profile source .bashrc 참고 https://rorlab.gitbooks.io/railsguidebook/content/contents/rbenv.html http:/..

modify 2018.11.27