[RUBY] Mac OS X Mountain Lion 10.8.5 Development environment construction

Items to install

Install JDK

Java SE Development Kit 8 Downloads

$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

Install homebrew

$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
=> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
 .
 .
 .
$ brew doctor
Your system is ready to brew.
$ brew update
Already up-to-date.
$ brew -v
Homebrew 0.9.5

Install MySQL

$ brew install mysql
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/mysql-5.6.17_1.mountain_lion.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/mysql-5.6.17_1.mountain_lion.bottle.tar.gz
 .
 .
 .

Install Git

$ git --version
git version 1.8.5.2 (Apple Git-48)
$ brew install git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-1.9.2.mountain_lion.bottle.tar.gz
 .
 .
 .
$ brew link git
$ git --version
git version 1.9.2

Install rbenv, Ruby, and Rails

$ brew install rbenv ruby-build
==> Downloading https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz
######################################################################## 100.0%
 .
 .
 .
$ sudo cat >> ~/.bash_profile << EOF
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
EOF
$ source ~/.bash_profile
$ rbenv -l
1.9.3-p545
 .
 .
 .
# Install Ruby 1.9.3
$ CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install 1.9.3-p545
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
Installing yaml-0.1.6...
 .
 .
 .
# Install Ruby 2.0.0
$ RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.0.0-p451
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
Installing yaml-0.1.6...
 .
 .
 .
$ rbenv rehash
$ rbenv global 1.9.3-p545
$ ruby -v
ruby 1.9.3p545 (2014-02-24 revision 45159) [x86_64-darwin12.5.0]
$ sudo cat >> ~/.gemrc << EOF
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
EOF
$ sudo cat >> ~/.gemrc << EOF
--skip-bundle
--skip-test-unit
EOF
$ gem install rails
Fetching: rails-4.1.0.gem (100%)
 .
 .
 .
$ rbenv rehash

Install Python

$ brew install python --universal --framework
==> Installing dependencies for python: pkg-config, readline, sqlite, gdbm, openssl
==> Installing python dependency: pkg-config
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/pkg-config-0.28.mountain_lion.bottle.2.tar.gz
######################################################################## 100.0%
 .
 .
 .
$ brew install python3 --universal --framework
==> Installing python3 dependency: xz
==> Downloading http://fossies.org/linux/misc/xz-5.0.5.tar.gz
######################################################################## 100.0%
 .
 .
 .
$ echo 'export PATH=/usr/local/bin:/usr/local/share/python:/usr/local/share/python3:$PATH' >> ~/.bash_profile
$ source ~/.bash_profile
$ python --version
Python 2.7.6
$ python3 --version
Python 3.4.0
$ brew update
$ pip install --upgrade setuptools
$ pip install --upgrade pip
$ pip3 install --upgrade setuptools
$ pip3 install --upgrade pip
$ brew linkapps
Linking /usr/local/Cellar/python/2.7.6_1/IDLE.app
Linking /usr/local/Cellar/python/2.7.6_1/Python Launcher.app
Linking /usr/local/Cellar/python3/3.4.0_1/IDLE 3.app
Linking /usr/local/Cellar/python3/3.4.0_1/Python Launcher 3.app
Finished linking. Find the links under /Applications.

Install distribute

$ curl http://python-distribute.org/distribute_setup.py | sudo python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17672  100 17672    0     0  18731      0 --:--:-- --:--:-- --:--:-- 18740
 .
 .
 .
$ curl http://python-distribute.org/distribute_setup.py | sudo python3
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17672  100 17672    0     0  11731      0  0:00:01  0:00:01 --:--:-- 19484
 .
 .
 .

Install virtualenv

$ pip install virtualenv virtualenvwrapper
Downloading/unpacking virtualenv
  Downloading virtualenv-1.11.4-py2.py3-none-any.whl (1.7MB): 1.7MB downloaded
 .
 .
 .
$ pip3 install virtualenv virtualenvwrapper
Downloading/unpacking virtualenv
  Downloading virtualenv-1.11.4-py2.py3-none-any.whl (1.7MB): 1.7MB downloaded
 .
 .
 .
$ sudo cat >> ~/.bashrc << EOF
source /usr/local/bin/virtualenvwrapper.sh
EOF
$ source ~/.bashrc
# virtualenv for Python 2.7.6
$ mkvirtualenv VIRTUALENV_NAME
# virtualenv for Python 3.4.0
$ mkvirtualenv VIRTUALENV_NAME --python /usr/local/bin/python3
$ workon VIRTUALENV_NAME
(VIRTUALENV_NAME)$ deactivate
$ exit

Install Django and python modules to virtualenv

$ workon VIRTUALENV_NAME
(VIRTUALENV_NAME)$ cat >> ./pip-install.txt << EOF
django
django-debug-toolbar
BeautifulSoup
South
feedparser
lxml
mysql-python
pattern
python-dateutil
readability-lxml
requests
six
unicodecsv
urllib3
EOF
(VIRTUALENV_NAME)$ pip install -r pip-install.txt
Downloading/unpacking django (from -r pip-install.txt (line 1))
  Downloading Django-1.6.3-py2.py3-none-any.whl (6.7MB): 6.7MB downloaded
 .
 .
 .
(VIRTUALENV_NAME)$ rm -f pip-install.txt
(VIRTUALENV_NAME)$ pip freeze
(VIRTUALENV_NAME)$ deactivate
$ exit

Install node.js, nvm, and grunt

$ brew install node
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/node-0.10.26.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
 .
 .
 .
$ git clone git://github.com/creationix/nvm.git ~/.nvm
Cloning into '/Users/gumob/.nvm'...
remote: Reusing existing pack: 1256, done.
 .
 .
 .
$ source ~/.nvm/nvm.sh
$ node -v
v0.10.26
$ nvm --version
nvm v0.5.1
$ npm --version
1.4.7
$ gem install sass compass
Fetching: sass-3.3.6.gem (100%)
Successfully installed sass-3.3.6
 .
 .
 .
$ npm install -g grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli
npm http 200 https://registry.npmjs.org/grunt-cli
 .
 .
 .
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
[email protected] /usr/local/lib/node_modules/grunt-cli
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])

Other configuration

$ sudo visudo
$ sudo cat /etc/sudoers
# User privilege specification
 .
 .
 .
# User privilege specification
root    ALL=(ALL) ALL
%admin  ALL=(ALL) ALL
username  ALL=(ALL) NOPASSWD: /usr/bin/rsync
 .
 .
 .

Recommended Posts

Mac OS X Mountain Lion 10.8.5 Development environment construction
Mac OS X Mavericks 10.9.5 Development environment construction
Mac OS X Yosemite 10.10 Development environment construction
Mac OS X development environment construction memo
Create a Python development environment on OS X Lion
Installed aws-cli On Mac OS X Lion
GeoDjango + SQLite environment construction on OS X
Continuation ・ Notes on preparing the Python development environment on Mac OS X
Build a Python environment on Mac (Mountain Lion)
Python development environment construction
Mac development environment construction (Ansible + Serverspec + Travis CI)
python2.7 development environment construction
Mac environment construction Python
Pyxel environment construction (Mac)
Create a Python development environment in 10 minutes (Mac OS X + Visual Studio Code)
Building an environment for "Tello_Video" on Mac OS X
Django development environment construction memo
Python environment construction For Mac
[MEMO] [Development environment construction] Python
Memo on Mac OS X
django project development environment construction
[MEMO] [Development environment construction] wine
Ansible environment construction For Mac
Create a GO development environment with [Mac OS Big Sur]
Mac + Eclipse (PyDev) + Django environment construction
Anaconda environment construction on Mac (2018 version)
Install Sphinx on Mac OS X
I checked Mac Python environment construction
Installation of scikit-learn (Mac OS X)
Python development environment construction on macOS
[MEMO] [Development environment construction] Jupyter Notebook
Install mitmproxy on Mac OS X
Environment construction of python3.8 on mac
Python3 TensorFlow for Mac environment construction
Emacs Python development environment construction memo
Ubuntu Desktop 20.04 development environment construction memo
Development environment construction (2020 version, WSL2 + VcXsrv)
Install pgmagick on Mac OS X 10.9
Environment construction procedure for the gym "Open AI Gym" that trains AI in games on Mac OS X
Python (anaconda) development environment construction procedure (SpringToolsSuites) _2020.4
WEB application development using django-Development environment construction-
How to prepare Python development environment [Mac]
Python3 + venv + VSCode + macOS development environment construction
Prepare the development environment for keyhac for Mac
Construction of development environment for Choreonoid class
Windows + gVim + Poetry python development environment construction
Run NASA CEA on Mac OS X
R environment construction with Jupyter (formerly IPython notebook) (on OS X El Capitan 10.11.3)
Run Qiita API v2 Python wrapper in Python3 environment (Mac OS X 10.11 (El Capitan))
Python3 TensorFlow environment construction (Mac and pyenv virtualenv)
Python explosive environment construction starting from zero (Mac)
EV3 x Pyrhon Machine Learning Part 1 Environment Construction
Kotlin / Native development environment construction & installation procedure & tutorial
Run Zookeeper x python (kazoo) on Mac OS X
Build a Python development environment on your Mac
[Environment construction] Oracle DB x Pro * C [Now]
Python 3.x environment construction by Pyenv (CentOS, Ubuntu)
From 0 to Django development environment construction to basic operation
Shpinx (Python documentation builder) on Mac OS X
[Note] How to create a Mac development environment
Install LightGBM in an OS X virtualenv environment