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

How to Setup Your Mac

How to Setup Your Mac

Mac での開発環境構築手順を説明します

Tetsuya Kaneko

February 08, 2014
Tweet

More Decks by Tetsuya Kaneko

Other Decks in Programming

Transcript

  1. How to setup your Mac 2014-02-08 AW ษڧձ Presented by

    @tetsuya
  2. Macͷੈք΁Α͏ͦ͜ʂ Macintosh͕ൃച͞Εͯࠓ೥Ͱ30प೥Λܴ͑·ͨ͠

  3. ·ͣ͸ɺΞϓϦέʔγϣϯ > ϢʔςΟϦςΟʔͱਐΈʮλʔϛφϧʯΛ։͍ͯΈ·͠ΐ͏

  4. versionίϚϯυΛ࢖ͬͯঢ়گΛ֬ೝͯ͠Έ·͠ΐ͏ ༷ʑͳ؀ڥ͕طʹೖ͍ͬͯ·͢Ͷ

  5. ͳͥϩʔΧϧ؀ڥΛԚͨ͘͠ͳ͍ͷ͔

  6. ※2014೥2݄8೔ݱࡏ ʊਓਓਓਓਓਓʊ ʼɹಈ͔ͳ͍ɹʻ ʉY^Y^Y^Y^Yʉ Legacy Code Python 3.3.3 
 ʢ࠷৽൛ʣ

    Python 2.7.5 
 (Default) Ξοϓσʔτ ໭ͤͳ͍
  7. $ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

  8. ύοέʔδ؅ཧγεςϜ(homebrew)Λ ಋೖͯ͠ΈΑ͏

  9. $ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

  10. Πϯετʔϧ $ brew install node

  11. $ brew update $ brew upgrade node Ξοϓσʔτ

  12. $ brew uninstall node ͑ʁ͜Ε͚ͩʁ͜Ε͚ͩͰ͢ ΞϯΠϯετʔϧ

  13. • ։ൃʹ͓͍ͯ͸ԿͰ΋࠷৽൛Λ͍Ε͓͚ͯ͹Α͍ͱ ͍͏Θ͚Ͱ͸ͳ͍ • Javaͱ͸ҧ͍ɺPython΍RubyͳͲޙํޓ׵ੑ͕௿ ͍ݴޠͰͷ։ൃͰ͸ɺόʔδϣϯΛ্͛Δ͜ͱͰશ ͘ಈ͔ͳ͘ͳΔ͜ͱ͕͋Δ

  14. homebrewͰRuby؅ཧ͢Ε͹͍͍Μ͡ΌͶʁ

  15. ࠩ͸ྺવ ṷ͸ṷ԰ɺRuby͸rbenv

  16. • શ͘ҧ͏όʔδϣϯ͕ڞଘՄೳ • ίϚϯυҰͭͰϝΠϯͷόʔδϣϯΛ੾Γସ͑ΒΕΔ OS homebrew rbenv ※2014೥2݄8೔ݱࡏ Ruby 2.0.0p247

    
 (Default) Ruby 2.0.0-p353 
 ʢ2.xܥ҆ఆ൛ʣ Ruby 2.1.0 
 ʢ࠷৽൛ʣ Ruby 1.9.3-p484 
 ʢ1.xܥ҆ఆ൛ʣ
  17. $ brew install rbenv ruby-build $ echo 'export RBENV_ROOT=/usr/local/var/rbenv' >>

    ~/.bash_pro fi le $ echo 'eval "$(rbenv init -)"' >> ~/.bash_pro fi le $ source ~/.bash_pro fi le $ rbenv install -l $ rbenv install 2.0.0-p353 $ rbenv rehash $ rbenv global 2.0.0-p353 $ ruby -v
  18. $ gem install rails $ rails new App1 $ cd

    App1 $ rails server
  19. OS homebrew gem App1 ※2014೥2݄8೔ݱࡏ Ruby 2.0.0p247 
 (Default) rbenv

    Ruby 2.0.0-p353 
 ʢ2.xܥ҆ఆ൛ʣ Ruby 2.1.0 
 ʢ࠷৽൛ʣ Ruby 1.9.3-p484 
 ʢ1.xܥ҆ఆ൛ʣ
  20. ࠞͬͯ͟͠·͏ʂ OS homebrew gem App1 App2 ※2014೥2݄8೔ݱࡏ Ruby 2.0.0p247 


    (Default) rbenv Ruby 2.0.0-p353 
 ʢ2.xܥ҆ఆ൛ʣ Ruby 2.1.0 
 ʢ࠷৽൛ʣ Ruby 1.9.3-p484 
 ʢ1.xܥ҆ఆ൛ʣ
  21. OS homebrew .ruby- version App1 App2 ※2014೥2݄8೔ݱࡏ Ruby 2.0.0p247 


    (Default) rbenv .ruby- version bundler bundler gem gem σΟϨΫτϦ͝ͱʹར༻͢ΔRubyͷόʔδϣϯΛࢦఆͰ͖Δ σΟϨΫτϦ͝ͱʹgemΛΠϯετʔϧͰ͖Δ Ruby 2.0.0-p353 
 ʢ2.xܥ҆ఆ൛ʣ Ruby 2.1.0 
 ʢ࠷৽൛ʣ Ruby 1.9.3-p484 
 ʢ1.xܥ҆ఆ൛ʣ
  22. .ruby- version rails Ruby 2.0.0-p353 
 ʢ2.xܥ҆ఆ൛ʣ rbenv bundler gem

    bundler gem ͕͜͜ΞϓϦຊମ ͜͜͸railsΠϯετʔϧޙ࡟আՄೳ
  23. .ruby- version rails Ruby 2.0.0-p353 
 ʢ2.xܥ҆ఆ൛ʣ rbenv bundler gem

    bundler gem ΧϨϯτ 
 σΟϨΫτϦΛ 
 ࢦఆ্ͯ͠ॻ͖
  24. ҰํPythonͰ͸

  25. Python͸pyenvͰ؅ཧ OS homebrew Python 2.7.5 
 (Default) Python 3.2.4 


    ʢ3.2ܥ࠷ऴ൛ʣ Python 3.4.0 
 beta 3 
 ʢ࠷৽β൛ʣ Python 2.7.6 
 ʢ2.xܥ࠷৽൛ʣ pyenv ※2014೥2݄8೔ݱࡏ
  26. ΍͸Γࠞͬͯ͟͠·ͬͨʂ OS homebrew Python 2.7.5 
 (Default) Python 3.2.4 


    ʢ3.2ܥ࠷ऴ൛ʣ Python 3.4.0 
 beta 3 
 ʢ࠷৽β൛ʣ Python 2.7.6 
 ʢ2.xܥ࠷৽൛ʣ pyenv pip App1 App2 ※2014೥2݄8೔ݱࡏ
  27. OS homebrew Python 2.7.5 
 (Default) Python 3.2.4 
 ʢ3.2ܥ࠷ऴ൛ʣ

    Python 3.4.0 
 beta 3 
 ʢ࠷৽β൛ʣ Python 2.7.6 
 ʢ2.xܥ࠷৽൛ʣ pyenv pip App1 App2 pip virtualenv Python 2.7.6 Python 2.7.6 ※2014೥2݄8೔ݱࡏ
  28. node΋ͳΜͪΌΒenv࢖ͬͯ؅ཧ͠ͳ͍ͷʁ

  29. • n • nave • ndenv • nenv • nodebrew

    • nodeenv • nvm ͳΜͪΌΒenv for node.js σΟϑΝΫτελϯμʔυ͕ͳ͍
  30. What about GUI tools?

  31. ͑ʁެࣜαΠτߦͬͯɺΠϯετʔϥDLͯ͠ɺΠϯετʔϧը໘ΛϙνϙνΛ Nճ܁Γฦ͢ΜͰ͔͢ʁ

  32. $tap phinze/homebrew-cask $install brew-cask $brew cask install virtualbox