레일즈 애플리케이션 생성

Jmnote (토론 | 기여)님의 2016년 1월 26일 (화) 09:16 판 (→‎중지)

1 사전 작업

2 애플리케이션 생성

railsuser@zetawiki:~$ rails new MyDemo
      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 MyDemo/
railsuser@zetawiki:~/MyDemo$ rails server &
[1] 10622
=> Booting WEBrick
=> Rails 4.2.5 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2016-01-25 16:55:33] INFO  WEBrick 1.3.1
[2016-01-25 16:55:33] INFO  ruby 2.2.1 (2015-02-26) [x86_64-linux]
[2016-01-25 16:55:33] INFO  WEBrick::HTTPServer#start: pid=2017 port=3000

4 확인

railsuser@zetawiki:~/MyDemo$ 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:~/MyDemo$ ps -ef | grep ruby
testuser 10622 10263  2 08:49 pts/1    00:00:03 /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby bin/rails server
testuser 10713 10263  0 08:51 pts/1    00:00:00 grep --color=auto ruby

5 중지

railsuser@zetawiki:~/MyDemo$ kill -9 `pidof ruby`
railsuser@zetawiki:~/MyDemo$ 
[1]+  Killed                  rails server
railsuser@zetawiki:~/MyDemo$ 
railsuser@zetawiki:~/MyDemo$ ps -ef | grep ruby
railsuser 10799 10263  0 08:53 pts/1    00:00:00 grep --color=auto ruby

6 같이 보기

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