Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails 開発環境としての Windows という選択肢

tikkss
July 14, 2018

Rails 開発環境としての Windows という選択肢

tikkss

July 14, 2018
Tweet

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • GitHub, Twitter: @tikkss • ᰤࢠ͕ר͚Δ Rails ΤϯδχΞ •

    Rails 2 ܥͷࠒ͔Β Rails Ͱडୗ։ൃͯ͠·͢ • from ౡࠜݝग़Ӣࢢ
  2. ࠓͲ͖ͷ;ͭ͏ͳ։ൃϑϩʔ 1. Zsh, fish, Tmux ౳ͷڧྗͳCLIπʔϧ 2. ghq, peco/fzf Λ࢖ͬͨϩʔΧϧϦϙδτϦ

    ͷ౷Ұతɾޮ཰తͳ؅ཧ 3. Docker Compose ౳ͷίϚϯυҰͭͰ։ൃ ؀ڥ্ཱͪ͛
  3. ࠓͲ͖ͷ;ͭ͏ͳ։ൃϑϩʔ 1. Zsh, fish, Tmux ౳ͷڧྗͳCLIπʔϧ 2. ghq, peco/fzf Λ࢖ͬͨϩʔΧϧϦϙδτϦ

    ͷ౷Ұతɾޮ཰తͳ؅ཧ 3. Docker Compose ౳ͷίϚϯυҰͭͰ։ൃ ؀ڥ্ཱͪ͛
  4. ࠓͲ͖ͷ;ͭ͏ͳ։ൃϑϩʔ 1. Zsh, fish, Tmux ౳ͷڧྗͳCLIπʔϧ 2. ghq, peco/fzf Λ࢖ͬͨϩʔΧϧϦϙδτϦ

    ͷ౷Ұతɾޮ཰తͳ؅ཧ 3. Docker Compose ౳ͷίϚϯυҰͭͰ։ൃ ؀ڥ্ཱͪ͛
  5. ࠓͲ͖ͷ;ͭ͏ͳ։ൃϑϩʔ 1. Zsh, fish, Tmux ౳ͷڧྗͳCLIπʔϧ 2. ghq, peco/fzf Λ࢖ͬͨϩʔΧϧϦϙδτϦ

    ͷ౷Ұతɾޮ཰తͳ؅ཧ 3. Docker Compose ౳ͷίϚϯυҰͭͰ։ൃ ؀ڥ্ཱͪ͛
  6. ࠓͲ͖ͷ;ͭ͏ͳ։ൃϑϩʔ 1. Zsh, fish, Tmux ౳ͷڧྗͳCLIπʔϧ 2. ghq, peco/fzf Λ࢖ͬͨϩʔΧϧϦϙδτϦ

    ͷ౷Ұతɾޮ཰తͳ؅ཧ 3. Docker Compose ౳ͷίϚϯυҰͭͰ։ൃ ؀ڥ্ཱͪ͛
  7. 1. Zsh, fish, Tmux ౳ͷڧྗͳCLI πʔϧ • ύοέʔδϚωʔδϟͰ;ͭ͏ʹΠϯετʔ ϧͰ͖ΔʢUbuntu ͷ৔߹ʣ

    • $ sudo apt-get install zsh fish tmux • WSL ͱ Unix ܥ OS ͷ dotfiles Λڞ༗Ͱ͖Δ
  8. 2. ghq, peco/fzf Λ࢖ͬͨϩʔΧϧ ϦϙδτϦͷ౷Ұతɾޮ཰తͳ؅ཧ • Windows -> WSL: ϑΝΠϧࢀরɾॻࠐɾ࣮ߦɹඇਪ঑

    • WSL -> Windows: ϑΝΠϧࢀরɾॻࠐɾ࣮ߦɹOK • Windows ͷϑΝΠϧ͸ /mnt/c/ ʹϘϦϡʔϜϚ΢ϯτ͞ΕΔ • Windows ͷϗʔϜσΟϨΫτϦ഑ԼʹϩʔΧϧϦϙδτϦΛ഑ ஔ • WSL ͷϗʔϜσΟϨΫτϦʹ Windows ͷϗʔϜσΟϨΫτϦͷ ϩʔΧϧϦϙδτϦ΁ͷγϯϘϦοΫϦϯΫΛషΔ
  9. Linux σʔϞϯ͕ಈ͔ͳ͍ • Docker daemon ͕ಈ͔ͳ͍ • Docker Client ͸

    WSL ͷ·· • Docker daemon ͸ Docker for Windows Λ ࢖͏
  10. Linux σʔϞϯ͕ಈ͔ͳ͍ • Docker daemon ͕ಈ͔ͳ͍ • Docker Client ͸

    WSL ͷ·· • Docker daemon ͸ Docker for Windows Λ࢖͏ • ࠓ೥ʢ2018೥ʣͷय़͔ΒσʔϞϯ͕ಈ͘Α͏ʹͳͬͨ • WSL ͚ͩͰ Docker ͕ಈ͘ʢୠ͠Ұ෦ͷVerݶఆʣ
  11. Docker Compose ͕ಈ͔ͳ͍ • Docker for Windows ͷ Docker daemon

    ͱ WSL ͷύεͷϛεϚονͰɺϘϦϡʔϜͷ૬ ରύεࢦఆ͕ಈ͔ͳ͍ • Docker for Windows: /c/ • WSL: /mnt/c/
  12. Docker Compose ͕ಈ͔ͳ͍ • Docker for Windows ͷ Docker daemon

    ͱ WSL ͷύεͷ ϛεϚονͰɺϘϦϡʔϜͷ૬ରύεࢦఆ͕ಈ͔ͳ͍ • Docker for Windows: /c/ • WSL: /mnt/c/ • ࠓ೥ʢ2018೥ʣͷय़͔Β WSL ͷϚ΢ϯτύεΛม͑ΕΔ • WSL ΋ /c/ ʹมߋ͢Ε͹ϛεϚονղܾ
  13. /etc/wsl.conf $ sudo vim /etc/wsl.conf [automount] root = / #

    => ઃఆޙɺWindowsΛ࠶ىಈ $ ln -s /c/Users/xxxxx/src ~/src # => લड़ͷϗʔϜσΟϨΫτϦ΁ͷγϯϘϦοΫϦϯΫ ͷύε͔Β /mnt ΛऔΔ
  14. ·ͱΊ • ;ͭ͏͸ਓʹΑͬͯೝ͕ࣝҧ͏ • ;ͭ͏ͷೝࣝΛ͋ΘͤΔͱ Rails ͷΑ͏ʹָͰ͖Δ • WSL ʹΑͬͯ

    Unix ܥ OS Ͱͷ։ൃϑϩʔͷ “;ͭ͏” Λɺ Windows ʹऔΓೖΕΔ͜ͱ͕Ͱ͖ͨ • “;ͭ͏” ͷϨʔϧʹ৐ΕͨͷͰ Unix ܥ OS ͱ Windows ྆ํͰര଎։ൃͰ͖Δͧ