"리눅스 rails 설치"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-==참고 자료== +==참고==))
 
(사용자 2명의 중간 판 40개는 보이지 않습니다)
1번째 줄: 1번째 줄:
;rails 설치
;rails 설치
;레일즈 설치
;레일즈 설치
;루비 온 레일즈 설치


==사전 작업==
==사전 작업==
*[[RVM ruby 설치]]
*[[리눅스 rbenv ruby 설치]] ★
:( 또는 [[리눅스 RVM ruby 설치]] )


==사용자 계정 생성==
==(Optional) 사용자 계정 생성==
* root 계정으로 rails를 설치하면 "Don't run Bundler as root."라는 메시지가 나온다.
* root 계정으로 rails를 설치하다 보면 "Don't run Bundler as root."라는 메시지가 나온다.<ref>http://stackoverflow.com/questions/27552523/bundle-install-rails-on-ubuntu</ref>
* 권장사항대로 별도의 계정을 만들어 진행한다.
* 권장사항대로 별도의 계정을 만들어 진행한다.
* 여기서는 간단히 railsuser라는 계정을 만들었는데, 다른 계정명을 써도 된다.
* 여기서는 간단히 railsuser라는 계정을 만들었는데, 다른 계정명을 써도 된다.
<source lang='cli'>
<source lang='console'>
root@zetawiki:~# useradd railsuser -m -G rvm -s /bin/bash
root@zetawiki:~# useradd railsuser -m -s /bin/bash
root@zetawiki:~# echo 'railsuser:P@ssw0rd' | chpasswd
root@zetawiki:~# cat /etc/passwd | grep railsuser
root@zetawiki:~# cat /etc/passwd | grep railsuser
railsuser:x:1000:1001::/home/railsuser:/bin/bash
railsuser:x:1000:1000::/home/railsuser:/bin/bash
</source>
<source lang='cli'>
root@zetawiki:~# cat /etc/group | grep railsuser
root@zetawiki:~# cat /etc/group | grep railsuser
rvm:x:1000:railsuser
railsuser:x:1000:
railsuser:x:1001:
</source>
</source>
<source lang='cli'>
<source lang='console'>
root@zetawiki:~# su - railsuser
root@zetawiki:~# su - railsuser
railsuser@zetawiki:~$ pwd
railsuser@zetawiki:~$ pwd
26번째 줄: 26번째 줄:


==확인==
==확인==
<source lang='cli'>
<source lang='console'>
railsuser@zetawiki:~$ rails -v
railsuser@zetawiki:~$ rails -v
The program 'rails' is currently not installedTo run 'rails' please ask your administrator to install the package 'rails'
The program 'rails' can be found in the following packages:
* ruby-railties-3.2
  * ruby-railties-4.0
Ask your administrator to install one of them
</source>
</source>
<source lang='cli'>
<source lang='console'>
railsuser@zetawiki:~$ gem list | grep rails
railsuser@zetawiki:~$ gem list | grep rails
railsuser@zetawiki:~$  
railsuser@zetawiki:~$  
36번째 줄: 39번째 줄:


==설치==
==설치==
<source lang='cli'>
<source lang='console'>
railsuser@zetawiki:~$ gem install rails
railsuser@zetawiki:~$ gem install rails
Fetching: i18n-0.7.0.gem (100%)
Fetching: rack-1.6.4.gem (100%)
Successfully installed i18n-0.7.0
Successfully installed rack-1.6.4
Fetching: thread_safe-0.3.5.gem (100%)
Fetching: concurrent-ruby-1.0.2.gem (100%)
Successfully installed thread_safe-0.3.5
Successfully installed concurrent-ruby-1.0.2
Fetching: tzinfo-1.2.2.gem (100%)
Fetching: sprockets-3.6.0.gem (100%)
Successfully installed tzinfo-1.2.2
Successfully installed sprockets-3.6.0
... (생략)
... (생략)
Parsing documentation for sprockets-rails-3.0.0
Installing ri documentation for sprockets-rails-3.0.0
Parsing documentation for rails-4.2.5
Installing ri documentation for rails-4.2.5
Done installing documentation for i18n, thread_safe, tzinfo, activesupport, builder, erubis, mini_portile2, nokogiri, rails-deprecated_sanitizer, rails-dom-testing, loofah, rails-html-sanitizer, actionview, rack, rack-test, actionpack, globalid, activejob, mime-types, mail, actionmailer, activemodel, arel, activerecord, thor, railties, concurrent-ruby, sprockets, sprockets-rails, rails after 842 seconds
30 gems installed
</source>
</source>


==확인 2==
==확인 2==
<source lang='cli'>
<source lang='console'>
root@zetawiki:~# rails -v
railsuser@zetawiki:~$ rails -v
Rails 4.2.5
Rails 4.2.5
</source>
</source>
<source lang='cli'>
<source lang='console'>
root@zetawiki:~# gem list | grep rails
railsuser@zetawiki:~$ gem list | grep rails
rails (4.2.5)
rails (4.2.5)
rails-deprecated_sanitizer (1.0.3)
rails-deprecated_sanitizer (1.0.3)
61번째 줄: 70번째 줄:
</source>
</source>


==데모 서버 생성==
==후속 작업==
<source lang='cli'>
*[[레일즈 애플리케이션 생성]]
root@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  vendor/assets/javascripts
      create  vendor/assets/javascripts/.keep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.keep
        run  bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all
non-root users on this machine.
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake 10.5.0
Using i18n 0.7.0
Installing json 1.8.3
Installing minitest 5.8.4
Using thread_safe 0.3.5
... (생략)
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
</source>


==같이 보기==
==같이 보기==
111번째 줄: 78번째 줄:
*[[루비젬]]
*[[루비젬]]


[[분류: gem]]
==참고==
[[분류: rails]]
*http://devyongsik.tistory.com/650
 
[[분류:Gem install]]
[[분류:레일즈]]

2017년 7월 11일 (화) 04:01 기준 최신판

rails 설치
레일즈 설치
루비 온 레일즈 설치

1 사전 작업[ | ]

( 또는 리눅스 RVM ruby 설치 )

2 (Optional) 사용자 계정 생성[ | ]

  • root 계정으로 rails를 설치하다 보면 "Don't run Bundler as root."라는 메시지가 나온다.[1]
  • 권장사항대로 별도의 계정을 만들어 진행한다.
  • 여기서는 간단히 railsuser라는 계정을 만들었는데, 다른 계정명을 써도 된다.
root@zetawiki:~# useradd railsuser -m -s /bin/bash
root@zetawiki:~# echo 'railsuser:P@ssw0rd' | chpasswd
root@zetawiki:~# cat /etc/passwd | grep railsuser
railsuser:x:1000:1000::/home/railsuser:/bin/bash
root@zetawiki:~# cat /etc/group | grep railsuser
railsuser:x:1000:
root@zetawiki:~# su - railsuser
railsuser@zetawiki:~$ pwd
/home/railsuser

3 확인[ | ]

railsuser@zetawiki:~$ rails -v
The program 'rails' can be found in the following packages:
 * ruby-railties-3.2
 * ruby-railties-4.0
Ask your administrator to install one of them
railsuser@zetawiki:~$ gem list | grep rails
railsuser@zetawiki:~$

4 설치[ | ]

railsuser@zetawiki:~$ gem install rails
Fetching: rack-1.6.4.gem (100%)
Successfully installed rack-1.6.4
Fetching: concurrent-ruby-1.0.2.gem (100%)
Successfully installed concurrent-ruby-1.0.2
Fetching: sprockets-3.6.0.gem (100%)
Successfully installed sprockets-3.6.0
... (생략)
Parsing documentation for sprockets-rails-3.0.0
Installing ri documentation for sprockets-rails-3.0.0
Parsing documentation for rails-4.2.5
Installing ri documentation for rails-4.2.5
Done installing documentation for i18n, thread_safe, tzinfo, activesupport, builder, erubis, mini_portile2, nokogiri, rails-deprecated_sanitizer, rails-dom-testing, loofah, rails-html-sanitizer, actionview, rack, rack-test, actionpack, globalid, activejob, mime-types, mail, actionmailer, activemodel, arel, activerecord, thor, railties, concurrent-ruby, sprockets, sprockets-rails, rails after 842 seconds
30 gems installed

5 확인 2[ | ]

railsuser@zetawiki:~$ rails -v
Rails 4.2.5
railsuser@zetawiki:~$ gem list | grep rails
rails (4.2.5)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.7)
rails-html-sanitizer (1.0.2)
sprockets-rails (3.0.0)

6 후속 작업[ | ]

7 같이 보기[ | ]

8 참고[ | ]

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