Dev/Ruby On Rails

Ruby On Rails 리눅스 상에 처음 설치하기

Itips 2019. 10. 5. 16:10
반응형

RVM 을 이용한 간편한 설치

https://rvm.io/rvm/install

 

1. 설치 패키지 검증을 위한 GPG 키 설치

$ gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3D2BAF1CF37B13E2069D6956105BD0E739499BDB

 

2. RVM 설치

$ \curl -sSL https://get.rvm.io | bash -s stable --ruby

$ source ~/.rvm/scripts/rvm

  - ~/.bashrc 에 추가하여 매번 실행하는 번거로움 제거

    $ echo 'source ~/.rvm/scripts/rvm' >> ~/.bashrc

$ ruby -v

 

3. Sqlite3 설치 확인 및 Rails 설치

https://guides.rubyonrails.org/getting_started.html

$ sqlite3 --version

$ gem install rails

$ rails --version

blog 라는 이름으로 새로운 프로젝트 시작

$ rails new blog

$ cd blog

$ rails server

 

만약 webpacker 관련 폴더가 없다는 에러 발생 시

$ rails webpacker:install 

 

그리고 재시작

$ rails server

=> Booting Puma
=> Rails 6.0.0 application starting in development 
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 3.12.1 (ruby 2.6.3-p62), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop

 

정상작동, 끝~!

 

반응형