Ruby On Rails

Ruby on Rails Server 세팅 방법

MorningPhys 2016. 1. 19. 13:33



1. Ruby 를 설치한다.

https://www.ruby-lang.org/ko/

- 설치시 Installation Destination and Optional Task 화면에서 옵션에 모두 체크해서 설치한다.

- 설치후 ruby - v 명령어로 설치된 버전정보를 확인한다.


2. SQLite 설치한다.



http://www.sqlite.org/download.html

- Precompiled Binaries for Windows : 

     sqlite-shell-win32-x86-3100100.zip(366.06 KiB) 받으면 된다.

Precompiled Binaries for Windows

sqlite-shell-win32-x86-3100100.zip
(366.06 KiB)

The command-line shell program (version 3.10.1).
(sha1: e89e907e7120fb31c9b74b363a4b8696af3b3370)

- 압축해제하면 sqlite3.exe 파일이 있을 텐데, 

이를 Ruby 바이너리 폴더(c:\ruby22\bin) 으로 옮긴다.

- 설치 후 sqlite3 -version 으로 설치된 버전정보를 확인한다.


3. DevKit 설치 방법

http://rubyinstaller.org/downloads/


DEVELOPMENT KIT

For use with Ruby 1.8.7 and 1.9.3:

For use with Ruby 2.0 and above (32bits version only):

For use with Ruby 2.0 and above (x64 - 64bits only)

위 링크에서 Ruby 버전과 OS 맞게 다운받아 설치한다.

압축 해제 후 c:\ruby22\에 devkit 폴더로 이동, 폴더 이름을 변경하도록 한다. 

cd c:\ruby200\devkit

ruby dk.rb init

자동 생성되는 config.yml 파일을 열어 ruby 루트 폴더가 입력되어 있는지 확인, 안되어 있을 경우 주석 해제

- c:\ruby22 

로 기록한 후 


ruby dk.rb install 한다. 


4. node.js 설치

https://nodejs.org/en/


Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Download for Windows (x86)

 


- 설치 후 node -v 로 설치 버전정보를 확인한다. 


5. ruby on rails 설치



c:\gem install rails 

시간이 조금 걸린다. 

설치가 완료되면, rails -v 명령어로 설치 버전 정보를 확인한다. 


6. 최종 프로젝트 생성(구동할 서버 루트)

- 여기서 오류가 많이 난다. 완전 멘붕 옮 ... 

c:\rails new project_name 하면 되는데, 오류가 무수히 많아 디버깅 과정은 다음과 같다. 

오류 : couldn't reserve space for cygwin's heap

해결방법 : Windows에 Ruby 설치하기(http://blog.tolinezip.com/) 를 참고하도록 한다. 


7. 생성이 완료되면, 해당 프로젝트 폴더로 이동하여 rails server 명령을 한다. 

 http://localhost:3000 으로 접속하여 첫 Rails 구동 페이지를 확인한다.  끝.





※ 참고 : Rails 개발 통합개발환경 Aptana Studio(http://www.aptana.com) 추천


참고 : https://github.com/Jpub/RubyonRails4


반응형