Rails 앱 작성의 최초 준비(cloud9)①
앱 콘테스트에 나갑니다!
2월에 공부를 시작해 아직 반년 초초자이지만,
여름 방학을 사용하여 자신의 레벨 업을 위해 도전하려고합니다.
오늘 ($ rails new)부터 완성까지의 기록을 가능한 한 남겨두고 싶습니다.
*한 일
1) Ruby의 버전 체크
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
2) gem rails 버전 5.1.1 설치
$ gem install rails -v 5.1.1
3) 프로젝트 [lessonplan]의 작성
$ rails new lessonplan -d postgresql
4) cloud9의 설정 「template0」을 추기
config/detabase.yml
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
template: template0 ←ここを追記
5) yarn 경유로 jquery, Bootstrap 설치
먼저 [lessonplan] 디렉토리로 이동
$ cd lessonplan
$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
OK
$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
deb https://dl.yarnpkg.com/debian/ stable main
$ sudo apt-get update && sudo apt-get install yarn
・・・(省略)・・・
Unpacking yarn (1.9.2-1) ...
Setting up yarn (1.9.2-1) ...
⇒설치 개시(잠시 걸린다)
$ yarn add jquery
yarn add v1.9.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]
$ yarn add bootstrap@3
yarn add v1.9.2
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]
Done in 0.95s.
js와 CSS에 추가
app/assets/javascripts/application.js
・・・(省略)・・・
//= require rails-ujs
//= require turbolinks
//= require jquery/dist/jquery.js ←ここを追記
//= require bootstrap/dist/js/bootstrap.min ←ここを追記
//= require_tree .
app/assets/stylesheets/application.css
/*
・・・(省略)・・・
*
*= require bootstrap/dist/css/bootstrap.min ←ここを追記
*= require_tree .
*= require_self
*/
개발 환경
Ruby 2.4.0
Rails -v 5.1.1
jQuery 3.3.1
Bootstrap 3.3.7
우선, 아래 준비 그 1은 여기까지.
체육관 가서 달리고 나서 계속하십시오.
Reference
이 문제에 관하여(Rails 앱 작성의 최초 준비(cloud9)①), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/37h/items/9cb04d0df54bb920a4ef텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)