아래 작업 전, 루비와 레일즈 설치가 미리 필요하다.
설치 후 터미널 창에 명령어들을 입력한다.
1. rails 어플리케이션 만들기
~$ rails new mySimpleApp --skip-spring
rails는 레일즈 명령어
2. 어플리케이션 폴더로 이동
:~$ cd mySimpleApp
:~/mySimpleApp$ ls
cd [폴더명]: change directory, [폴더명]에 해당하는 위치로 이동
(디렉토리가 ~$에서 ~/mySimpleApp$로 바뀜)
ls: list 디렉토리 내부의 파일과 하위 디렉토리 목록 출력
3. 새로 생긴 파일들의 목적
File/folder |
Purpose |
app/ |
Contains the controllers, models, views, helpers, mailers and assets for your application. |
bin/ |
Contains the rails script that starts your app and can contain other scripts you use to setup, update, deploy or run your application. |
config/ |
|
config.ru |
Rack configuration for Rack based servers used to start the application. |
db/ |
Contains your current database schema, as well as the database migrations. |
Gemfile |
|
Gemfile.lock |
|
lib/ |
Extended modules for your application. |
log/ |
Application log files. |
public/ |
The only folder seen by the world as-is. Contains static files and compiled assets. |
Rakefile |
This file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib/tasks directory of your application. |
README.md |
This is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on. |
test/ |
Unit tests, fixtures, and other test apparatus. These are covered in Testing Rails Applications. |
tmp/ |
Temporary files (like cache and pid files). |
vendor/ |
A place for all third-party code. In a typical Rails application this includes vendored gems. |