레일즈 애플리케이션 생성

creating a rails application
레일즈 애플리케이션 생성, 레일즈 앱 만들기

1 사전 작업[ | ]

2 애플리케이션 생성[ | ]

railsuser@zetawiki:~$ rails new my_app
      create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
... (생략)
Installing uglifier 2.7.2
Installing web-console 2.2.1
Bundle complete! 12 Gemfile dependencies, 54 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
         run  bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted

3 확인[ | ]

railsuser@zetawiki:~$ cd my_app/
railsuser@zetawiki:~/my_app$ ll
total 72
drwxr-xr-x 12 railsuser railsuser 4096 Jan 26 11:07 ./
drwxr-xr-x  4 railsuser railsuser 4096 Jan 26 11:06 ../
drwxr-xr-x  8 railsuser railsuser 4096 Jan 26 11:06 app/
drwxr-xr-x  2 railsuser railsuser 4096 Jan 26 11:07 bin/
drwxr-xr-x  5 railsuser railsuser 4096 Jan 26 11:06 config/
-rw-r--r--  1 railsuser railsuser  153 Jan 26 11:06 config.ru
drwxr-xr-x  2 railsuser railsuser 4096 Jan 26 11:06 db/
-rw-r--r--  1 railsuser railsuser 1502 Jan 26 11:06 Gemfile
-rw-r--r--  1 railsuser railsuser 3868 Jan 26 11:07 Gemfile.lock
-rw-r--r--  1 railsuser railsuser  474 Jan 26 11:06 .gitignore
drwxr-xr-x  4 railsuser railsuser 4096 Jan 26 11:06 lib/
drwxr-xr-x  2 railsuser railsuser 4096 Jan 26 11:07 log/
drwxr-xr-x  2 railsuser railsuser 4096 Jan 26 11:06 public/
-rw-r--r--  1 railsuser railsuser  249 Jan 26 11:06 Rakefile
-rw-r--r--  1 railsuser railsuser  478 Jan 26 11:06 README.rdoc
drwxr-xr-x  8 railsuser railsuser 4096 Jan 26 11:06 test/
drwxr-xr-x  6 railsuser railsuser 4096 Jan 26 11:07 tmp/
drwxr-xr-x  3 railsuser railsuser 4096 Jan 26 11:06 vendor/

4 서버 시작[ | ]

railsuser@zetawiki:~/my_app$ rails server -d
=> Booting WEBrick
=> Rails 4.2.5 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options

5 확인 2[ | ]

railsuser@zetawiki:~/my_app$ netstat -tnlp | grep ruby
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:3000          0.0.0.0:*               LISTEN      10622/ruby      
tcp6       0      0 ::1:3000                :::*                    LISTEN      10622/ruby
railsuser@zetawiki:~/my_app$ ps -ef | grep ruby | grep -v grep
testuser 10622 10263  2 08:49 pts/1    00:00:03 /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby bin/rails server -d

6 서버 중지[ | ]

railsuser@zetawiki:~/my_app$ kill -9 `pidof ruby`
railsuser@zetawiki:~/my_app$ ps -ef | grep ruby | grep -v grep
railsuser@zetawiki:~/my_app$

7 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}