Cov txheej txheem:

Gemfile nyob qhov twg?
Gemfile nyob qhov twg?

Video: Gemfile nyob qhov twg?

Video: Gemfile nyob qhov twg?
Video: happy_gemfile - Organise your Gemfile 2024, Tej zaum
Anonim

Gemfile yog ib cov ntaub ntawv uas yuav tsum tau nyob rau hauv lub hauv paus ntawm koj rails project. Nws yog siv los piav txog lub pov haum kev vam meej rau Ruby cov kev pab cuam. Thawj qhov hauv koj gemfile yog ib qhov chaw uas koj qhia rau Gemfile qhov twg mus nrhiav gems. Qhov chaw tuaj yeem hu ua qhov thaiv thiab koj tuaj yeem muaj ntau qhov chaw hauv koj li gemfile.

Ua li no, kuv yuav muab Gemfile qhov twg?

A Gemfile piav qhia txog lub pov haum kev vam meej uas yuav tsum tau ua raws li Ruby code. Qhov chaw tus Gemfile nyob rau hauv lub hauv paus ntawm cov directory uas muaj cov txheej txheem txuam. Piv txwv li, hauv daim ntawv thov Rails, qhov chaw tus Gemfile nyob rau hauv tib phau ntawv raws li Rakefile.

Ib tug kuj yuav nug, qhov twg yog bundler ntsia? lub pov haum cov ntaub ntawv koj app siv hauv cov neeg muag khoom / cache. Khiav pob nruab yuav nyiam gems nyob rau hauv tus neeg muag khoom / cache rau gems nyob rau hauv lwm qhov chaw. Ntawm no /usr/local/lib/ruby/gems/2.1. 0/gems/ thiab ntawm no: /usr/local/lib/ruby/gems/2.1.

Kuj Paub, Gemfile yog dab tsi?

A Gemfile yog ib cov ntaub ntawv peb tsim uas yog siv los piav txog lub pov haum dependencies rau Ruby cov kev pab cuam. Lub pov haum yog ib phau ntawm Ruby code uas peb tuaj yeem rho tawm mus rau hauv "sau" uas peb tuaj yeem hu tom qab.

Koj khiav lub pov haum li cas?

Kev teeb tsa Bundler

  1. Qhib lub qhov rais terminal thiab khiav cov lus txib nram qab no:
  2. Nkag mus rau koj qhov project root directory.
  3. Nruab tag nrho cov pob zeb uas xav tau los ntawm koj qhov chaw teev tseg:
  4. Hauv koj lub app, thauj khoom ib puag ncig bundled:
  5. Khiav ib qho executable uas tuaj nrog lub pov haum hauv koj pob khoom:

Pom zoo: