"레일즈 애플리케이션 생성"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 2명의 중간 판 4개는 보이지 않습니다)
6번째 줄: 6번째 줄:


==애플리케이션 생성==
==애플리케이션 생성==
<source lang='cli'>
<syntaxhighlight lang='console'>
railsuser@zetawiki:~$ rails new my_app
railsuser@zetawiki:~$ rails new my_app
       create   
       create   
32번째 줄: 32번째 줄:
* bin/rake: spring inserted
* bin/rake: spring inserted
* bin/rails: spring inserted
* bin/rails: spring inserted
</source>
</syntaxhighlight>


==확인==
==확인==
{{참고|레일즈 애플리케이션 구조}}
{{참고|레일즈 애플리케이션 구조}}
<source lang='cli'>
<syntaxhighlight lang='console'>
railsuser@zetawiki:~$ cd my_app/
railsuser@zetawiki:~$ cd my_app/
railsuser@zetawiki:~/my_app$ ll
railsuser@zetawiki:~/my_app$ ll
58번째 줄: 58번째 줄:
drwxr-xr-x  6 railsuser railsuser 4096 Jan 26 11:07 tmp/
drwxr-xr-x  6 railsuser railsuser 4096 Jan 26 11:07 tmp/
drwxr-xr-x  3 railsuser railsuser 4096 Jan 26 11:06 vendor/
drwxr-xr-x  3 railsuser railsuser 4096 Jan 26 11:06 vendor/
</source>
</syntaxhighlight>


== 서버 시작 ==
== 서버 시작 ==
<source lang='cli'>
<syntaxhighlight lang='console'>
railsuser@zetawiki:~/my_app$ rails server -d
railsuser@zetawiki:~/my_app$ rails server -d
=> Booting WEBrick
=> Booting WEBrick
=> Rails 4.2.5 application starting in development on http://localhost:3000
=> Rails 4.2.5 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Run `rails server -h` for more startup options
</source>
</syntaxhighlight>


==확인 2==
==확인 2==
<source lang='cli'>
<syntaxhighlight lang='console'>
railsuser@zetawiki:~/my_app$ netstat -tnlp | grep ruby
railsuser@zetawiki:~/my_app$ netstat -tnlp | grep ruby
(Not all processes could be identified, non-owned process info
(Not all processes could be identified, non-owned process info
75번째 줄: 75번째 줄:
tcp        0      0 127.0.0.1:3000          0.0.0.0:*              LISTEN      10622/ruby       
tcp        0      0 127.0.0.1:3000          0.0.0.0:*              LISTEN      10622/ruby       
tcp6      0      0 ::1:3000                :::*                    LISTEN      10622/ruby   
tcp6      0      0 ::1:3000                :::*                    LISTEN      10622/ruby   
</source>
</syntaxhighlight>
<source lang='cli'>
<syntaxhighlight lang='console'>
railsuser@zetawiki:~/my_app$ ps -ef | grep ruby | grep -v grep
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
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
</source>
</syntaxhighlight>


==서버 중지==
==서버 중지==
<source lang='cli'>
<syntaxhighlight lang='console'>
railsuser@zetawiki:~/my_app$ kill -9 `pidof ruby`
railsuser@zetawiki:~/my_app$ kill -9 `pidof ruby`
railsuser@zetawiki:~/my_app$ ps -ef | grep ruby | grep -v grep
railsuser@zetawiki:~/my_app$ ps -ef | grep ruby | grep -v grep
railsuser@zetawiki:~/my_app$  
railsuser@zetawiki:~/my_app$  
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[레일즈 서버 시작/중지]]
*[[레일즈 서버 시작/중지]]
*[[Errno::EADDRINUSE]]
*[[Errno::EADDRINUSE]]
*[[레일즈 애플리케이션 구조]]
*[[레일즈 application.rb]]


[[분류: rails]]
[[분류:레일즈]]

2021년 9월 24일 (금) 23:29 기준 최신판

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 }}