Cov txheej txheem:

Kuv yuav qhib a.RB cov ntaub ntawv hauv Windows li cas?
Kuv yuav qhib a.RB cov ntaub ntawv hauv Windows li cas?

Video: Kuv yuav qhib a.RB cov ntaub ntawv hauv Windows li cas?

Video: Kuv yuav qhib a.RB cov ntaub ntawv hauv Windows li cas?
Video: Kablia vwj& koj tsis yuav kuv nkauj tshiab 2019_2020 2024, Kaum ib hlis
Anonim

Yuav ua li cas rau nruab thiab khiav Ruby ntawm Windows

  1. Mus rau Ruby Installer hauv koj lub web browser.
  2. Nyem qhov loj liab Download khawm. Ib daim ntawv teev npe ntawm RubyInstallers tshwm.
  3. Nyem Ruby 2.2. 2 nyob ze rau saum cov npe RubyInstallers.
  4. Khiav lub installer program los ntawm xaiv Run Program (yog tias Qhov rai nthuav tawm qhov kev xaiv no) lossis ob-nias qhov ntaub ntawv thaum nws tiav download.

Ib yam li ntawd, koj yuav qhib cov ntaub ntawv. RB li cas?

Qhib ib lub qhov rais hais kom ua kab thiab taw rau koj Ruby scripts directory siv cd hais kom ua. Thaum muaj, koj tuaj yeem sau npe cov ntaub ntawv , siv cov lus txib dir ntawm Windows lossis ls hais kom ua ntawm Linux lossis OS X. Koj Ruby cov ntaub ntawv txhua tus yuav muaj. rb file txuas ntxiv.

Tsis tas li ntawd, Ruby ntawm Rails tuaj yeem khiav ntawm Windows? Koj ua tau siv Ruby hauv Qhov rai nrog Ruby rau Qhov rai tab sis yog tias koj xav siv Rails Kuv xav kom koj siv WSL. WSL yog luv rau Qhov rai Subsystem rau Linux thiab nws tsim Linux ib puag ncig hauv Qhov rai.

Ua li no, kuv yuav ua li cas thiaj paub yog Ruby tau nruab rau ntawm Windows?

Rau xyuas yog Ruby ntsia kom raug, qhib lub Run dialog box ( Qhov rai Key + R) thiab ntaus powershell. Hauv PowerShell qhov rai ntaus hauv cov lus txib ruby -v. Yog txhua yam mus zoo koj yuav tsum pom cov lus zoo li ruby 1.9.

Kuv yuav khiav Ruby cov ntaub ntawv hauv Terminal li cas?

Txhawm rau ua tiav koj cov ntaub ntawv ruby raws li tsab ntawv:

  1. pib koj qhov program nrog #!/usr/bin/env ruby.
  2. khiav cov ntawv ntawd siv./your_program. rb pem.
  3. Yog tias koj tsis tuaj yeem ua tiav tsab ntawv no kos kev tso cai rau cov ntaub ntawv.

Pom zoo: