{"id":2349,"date":"2015-12-22T00:00:27","date_gmt":"2015-12-21T15:00:27","guid":{"rendered":"http:\/\/www.magtranetwork.com\/?p=2349"},"modified":"2017-03-06T11:35:45","modified_gmt":"2017-03-06T02:35:45","slug":"aws_ec2_pyenv_rbenv_ndenv_system_install_for_python_ruby_nodejs","status":"publish","type":"post","link":"https:\/\/www.magtranetwork.com\/aws\/aws_ec2_pyenv_rbenv_ndenv_system_install_for_python_ruby_nodejs.html","title":{"rendered":"pyenv\u3001rbenv\u3001ndenv\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u30fb\u30b7\u30b9\u30c6\u30e0\u30ef\u30a4\u30c9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001Python\u3001Ruby\u3001Node.js\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u3044\u5206\u3051\u308b \u301cAmazon Linux\u3001CentOS\u3067\u5b9f\u884c\u3067\u304d\u308b\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u81ea\u52d5\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)\u301c"},"content":{"rendered":"

AWS\u306eAmazon EC2\u306b\u304a\u3044\u3066Amazon Linux\u3084CentOS\u306a\u3069\u3092\u7528\u3044\u3066\u30b5\u30fc\u30d0\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u88c5\u3059\u308b\u969b\u306b\u30b7\u30b9\u30c6\u30e0\u8981\u4ef6\u3067\u4f7f\u7528\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u6307\u5b9a\u30fb\u9650\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3082\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\u305d\u306e\u5834\u5408\u3001\u904b\u826f\u304f\u8a72\u5f53\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304cyum\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u3042\u308c\u3070\u826f\u3044\u306e\u3067\u3059\u304c\u3001\u8a72\u5f53\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304cyum\u306b\u5b58\u5728\u3057\u306a\u3051\u308c\u3070\u30bd\u30fc\u30b9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n

\u305f\u3060\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u914d\u5e03\u5143\u304b\u3089\u305d\u306e\u307e\u307e\u30bd\u30fc\u30b9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5165\u308c\u66ff\u3048\u308b\u5834\u5408\u306a\u3069\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u306e\u70b9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u8907\u96d1\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n

\u4eca\u56de\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9ePython\u3001Ruby\u3001Node.js\u3067\u305d\u308c\u305e\u308c\u6709\u5fd7\u304c\u7528\u610f\u3057\u3066\u3044\u308b\u7c21\u5358\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u5207\u308a\u66ff\u3048\u304c\u53ef\u80fd\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30c4\u30fc\u30ebpyenv\u3001rbenv\u3001ndenv\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u30fb\u30b7\u30b9\u30c6\u30e0\u30ef\u30a4\u30c9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u5099\u5fd8\u9332\u3068\u3057\u3066\u8a18\u8f09\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n

\u3061\u306a\u307f\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9ePython\u3001Ruby\u3001Node.js\u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30c4\u30fc\u30ebpyenv\u3001rbenv\u3001ndenv\u306e\u5bfe\u5fdc\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n

Python\uff1apyenv
\nRuby\uff1arbenv
\nNode.js\uff1andenv<\/p>\n

pyenv\u3001rbenv\u3001ndenv\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u30fb\u30b7\u30b9\u30c6\u30e0\u30ef\u30a4\u30c9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001Python\u3001Ruby\u3001Node.js\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u3044\u5206\u3051\u308b \u301cAmazon Linux\u3001CentOS\u3067\u5b9f\u884c\u3067\u304d\u308b\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u81ea\u52d5\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)\u301c<\/h2>\n

yum\u3067\u524d\u63d0\u3068\u306a\u308b\u5fc5\u8981\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h3>\n
\r\nyum install -y gcc gcc-c++ make git openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel\r\n<\/pre>\n

pyenv\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u30fb\u30b7\u30b9\u30c6\u30e0\u30ef\u30a4\u30c9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066Python\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n

pyenv\u3092\/usr\/local\/\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n
\r\n[mag4j@localhost ~]# sudo su -\r\n[root@localhost ~]# git clone https:\/\/github.com\/pyenv\/pyenv.git \/usr\/local\/pyenv\r\n[root@localhost ~]# git clone https:\/\/github.com\/pyenv\/pyenv-virtualenv.git \/usr\/local\/pyenv\/plugins\/pyenv-virtualenv\r\n<\/pre>\n

\u30ed\u30b0\u30a4\u30f3\u6642\u306b\u8a2d\u5b9a\u3092\u8aad\u307f\u8fbc\u3080\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8a18\u8ff0<\/h4>\n
\r\n[root@localhost ~]# vim \/etc\/profile.d\/pyenv.sh\r\nexport PYENV_ROOT="\/usr\/local\/pyenv"\r\nexport PATH="${PYENV_ROOT}\/bin:${PATH}"\r\neval "$(pyenv init -)"\r\n<\/pre>\n

\u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u3092\u5b9f\u884c<\/h4>\n
\r\n[root@localhost ~]# exec $SHELL -l\r\n<\/pre>\n

pyenv\u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066Python\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u4e00\u89a7\u3092\u53c2\u7167<\/p>\n

\r\n[root@localhost ~]# pyenv install -l\r\n<\/pre>\n

\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n

\r\n[root@localhost ~]# pyenv install 2.7.13\r\n<\/pre>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d<\/p>\n

\r\n[root@localhost ~]# pyenv versions\r\n<\/pre>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u3067\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a<\/p>\n

\r\n[root@localhost ~]# pyenv global 2.7.13\r\n[root@localhost ~]# pyenv rehash\r\n<\/pre>\n

python\u30b3\u30de\u30f3\u30c9\u304c\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u5b9f\u884c\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d<\/p>\n

\r\n[root@localhost ~]# python --version\r\n<\/pre>\n

rbenv\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u30fb\u30b7\u30b9\u30c6\u30e0\u30ef\u30a4\u30c9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066Ruby\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n

rbenv\u3092\/usr\/local\/\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n
\r\n[mag4j@localhost ~]# sudo su -\r\n[root@localhost ~]# git clone https:\/\/github.com\/rbenv\/rbenv.git \/usr\/local\/rbenv\r\n[root@localhost ~]# git clone https:\/\/github.com\/rbenv\/ruby-build.git \/usr\/local\/rbenv\/plugins\/ruby-build\r\n<\/pre>\n

\u30ed\u30b0\u30a4\u30f3\u6642\u306b\u8a2d\u5b9a\u3092\u8aad\u307f\u8fbc\u3080\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8a18\u8ff0<\/h4>\n
\r\n[root@localhost ~]# vim \/etc\/profile.d\/rbenv.sh\r\nexport RBENV_ROOT="\/usr\/local\/rbenv"\r\nexport PATH="${RBENV_ROOT}\/bin:${PATH}"\r\neval "$(rbenv init -)"\r\n<\/pre>\n

\u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u3092\u5b9f\u884c<\/h4>\n
\r\n[root@localhost ~]# exec $SHELL -l\r\n<\/pre>\n

rbenv\u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066Ruby\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u4e00\u89a7\u3092\u53c2\u7167<\/p>\n

\r\n[root@localhost ~]# rbenv install -l\r\n<\/pre>\n

\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n

\r\n[root@localhost ~]# rbenv install 2.3.3\r\n<\/pre>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d<\/p>\n

\r\n[root@localhost ~]# rbenv versions\r\n<\/pre>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u3067\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a<\/p>\n

\r\n[root@localhost ~]# rbenv global 2.3.3\r\n[root@localhost ~]# rbenv rehash\r\n<\/pre>\n

ruby\u30b3\u30de\u30f3\u30c9\u304c\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u5b9f\u884c\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d<\/p>\n

\r\n[root@localhost ~]# ruby -v\r\n<\/pre>\n

ndenv\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u30fb\u30b7\u30b9\u30c6\u30e0\u30ef\u30a4\u30c9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066Node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n

ndenv\u3092\/usr\/local\/\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n
\r\n[mag4j@localhost ~]# sudo su -\r\n[root@localhost ~]# git clone https:\/\/github.com\/riywo\/ndenv.git \/usr\/local\/ndenv\r\n[root@localhost ~]# mkdir -p \/usr\/local\/ndenv\/plugins\r\n[root@localhost ~]# git clone https:\/\/github.com\/riywo\/node-build.git \/usr\/local\/ndenv\/plugins\/node-build\r\n<\/pre>\n

\u30ed\u30b0\u30a4\u30f3\u6642\u306b\u8a2d\u5b9a\u3092\u8aad\u307f\u8fbc\u3080\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8a18\u8ff0<\/h4>\n
\r\n[root@localhost ~]# vim \/etc\/profile.d\/ndenv.sh\r\nexport NDENV_ROOT=\/usr\/local\/ndenv\r\nexport PATH="$NDENV_ROOT\/bin:$PATH"\r\neval "$(ndenv init -)" \r\n<\/pre>\n

\u30ed\u30b0\u30a4\u30f3\u30b7\u30a7\u30eb\u3092\u5b9f\u884c<\/h4>\n
\r\n[root@localhost ~]# exec $SHELL -l\r\n<\/pre>\n

ndenv\u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066Node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u4e00\u89a7\u3092\u53c2\u7167<\/p>\n

\r\n[root@localhost ~]# ndenv install -l\r\n<\/pre>\n

\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n

\r\n[root@localhost ~]# ndenv install v6.9.2\r\n<\/pre>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d<\/p>\n

\r\n[root@localhost ~]# ndenv versions\r\n<\/pre>\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u3067\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a<\/p>\n

\r\n[root@localhost ~]# ndenv global v6.9.2\r\n[root@localhost ~]# ndenv rehash\r\n<\/pre>\n

node\u30b3\u30de\u30f3\u30c9\u304c\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u5b9f\u884c\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d<\/p>\n

\r\n[root@localhost ~]# node -v\r\n<\/pre>\n

pyenv\u3001rbenv\u3001ndenv\u3067\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u524a\u9664\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)<\/h2>\n

\u4e0a\u8a18\u3067pyenv\u3001rbenv\u3001ndenv\u3092\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u30fb\u30b7\u30b9\u30c6\u30e0\u30ef\u30a4\u30c9\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001Python\u3001Ruby\u3001Node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u307e\u3057\u305f\u3002<\/p>\n

\u7d9a\u3044\u3066\u306fpyenv\u3001rbenv\u3001ndenv\u305d\u308c\u305e\u308c\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u6700\u65b0\u5316\u3057\u305f\u4e0a\u3067\u3001\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePython\u3001Ruby\u3001Node.js\u306b\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u307e\u305f\u306f\u30c0\u30a6\u30f3\u30b0\u30ec\u30fc\u30c9\u3057\u3001\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u4ee5\u5916\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n

\u4e3b\u306bpyenv\u3001rbenv\u3001ndenv\u3092\u7528\u3044\u305fPython\u3001Ruby\u3001Node.js\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u904b\u7528\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n

pyenv\u3067Python\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u524a\u9664\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)<\/h3>\n

\uff1c\u5b9f\u884c\u5185\u5bb9\uff1e
\n\u30fb\u73fe\u5728\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePIP\u30ea\u30b9\u30c8\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8
\n\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePython\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb
\n\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u4ee5\u5916\u306ePython\u3068PIP\u306e\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb
\n\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5229\u7528\u8a2d\u5b9a
\n\u30fb\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u305fPIP\u30ea\u30b9\u30c8\u304b\u3089PIP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n

\r\nvim install_new_python.sh\r\n<\/pre>\n
\r\n#!\/bin\/bash\r\n\r\nWORK_DIR=\/tmp\r\nPIP_LIST_FILE=\/tmp\/pip_freeze.txt\r\n\r\nuninstall() {\r\n  pip freeze | grep -v "^-e" | xargs pip uninstall -y\r\n}\r\n\r\nNEW_VER=$1\r\n\r\nif [ "${NEW_VER}" = "" ]; then\r\n  echo "Input Target Version."\r\n  exit 1\r\nfi\r\n\r\npip freeze > ${PIP_LIST_FILE}\r\n\r\nPYENVPATH=`pyenv root`\r\necho $PYENVPATH\r\ncd $PYENVPATH\r\ngit pull\r\ncd ${WORK_DIR}\r\n\r\nIS_VER=`pyenv install -l | grep "${NEW_VER}$" | wc -l`\r\n\r\nif [ "${IS_VER}" = "0" ]; then\r\n  echo "Target Version is not Exists."\r\n  rm -rf ${PIP_LIST_FILE}\r\n  exit 1\r\nfi\r\n\r\npyenv install ${NEW_VER}\r\npyenv global ${NEW_VER}\r\npyenv rehash\r\n\r\nPYTHONS=`ls -1 $PYENVPATH\/versions | grep -v ${NEW_VER}`\r\nfor python in $PYTHONS; do\r\n  echo '---------------------------------------'\r\n  echo $python\r\n  pyenv local $python\r\n  uninstall\r\n  pyenv uninstall $python\r\ndone\r\n\r\npyenv global ${NEW_VER}\r\npyenv rehash\r\n\r\nrm -f ~\/.python-version\r\n\r\npip install pip --upgrade\r\npip install setuptools --upgrade\r\npip install -r ${PIP_LIST_FILE}\r\n\r\n<\/pre>\n

\uff1c\u5b9f\u884c\u4f8b\uff1e
\n\u30fbpyenv\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8(git pull\u306b\u3088\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u6700\u65b0\u5316)
\n\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u691c\u7d22\u3059\u308b\u3002<\/p>\n

\r\ncd `pyenv root` && git pull\r\npyenv install -l\r\n<\/pre>\n

\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5f15\u6570\u306b\u8a2d\u5b9a\u3057\u3066\u5b9f\u884c\u3059\u308b\u3002<\/p>\n

\r\nbash install_new_python.sh 2.7.13\r\n<\/pre>\n

rbenv\u3067Ruby\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u524a\u9664\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)<\/h3>\n

\uff1c\u5b9f\u884c\u5185\u5bb9\uff1e
\n\u30fb\u73fe\u5728\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306eGEM\u30ea\u30b9\u30c8\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8
\n\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306eRuby\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb
\n\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u4ee5\u5916\u306eRuby\u3068GEM\u306e\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb
\n\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5229\u7528\u8a2d\u5b9a
\n\u30fb\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u305fGEM\u30ea\u30b9\u30c8\u304b\u3089\u6700\u65b0\u306eGEM\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n

\r\nvim install_new_ruby.sh\r\n<\/pre>\n
\r\n#!\/bin\/bash\r\n\r\nWORK_DIR=\/tmp\r\nGEM_LIST_FILE=\/tmp\/gem_list.txt\r\n\r\nuninstall() {\r\n  list=`gem list --no-versions`\r\n  for gem in $list; do\r\n    gem uninstall $gem -aIx\r\n  done\r\n  gem list\r\n  gem install bundler\r\n}\r\n\r\nNEW_VER=$1\r\n\r\nif [ "${NEW_VER}" = "" ]; then\r\n  echo "Input Target Version."\r\n  exit 1\r\nfi\r\n\r\ngem list > ${GEM_LIST_FILE}\r\n\r\nRBENVPATH=`rbenv root`\r\necho $RBENVPATH\r\ncd $RBENVPATH\r\ngit pull\r\ncd ${WORK_DIR}\r\n\r\nIS_VER=`rbenv install -l | grep "${NEW_VER}$" | wc -l`\r\n\r\nif [ "${IS_VER}" = "0" ]; then\r\n  echo "Target Version is not Exists."\r\n  exit 1\r\nfi\r\n\r\nrbenv install ${NEW_VER}\r\nrbenv global ${NEW_VER}\r\nrbenv rehash\r\n\r\nRUBIES=`ls -1 $RBENVPATH\/versions | grep -v ${NEW_VER}`\r\nfor ruby in $RUBIES; do\r\n  echo '---------------------------------------'\r\n  echo $ruby\r\n  rbenv local $ruby\r\n  uninstall\r\n  rbenv uninstall $ruby\r\ndone\r\n\r\nrbenv global ${NEW_VER}\r\nrbenv rehash\r\n\r\nrm -f ~\/.ruby-version\r\n\r\ngem install `cat ${GEM_LIST_FILE} | awk '{print $1}'`\r\n\r\n<\/pre>\n

\uff1c\u5b9f\u884c\u4f8b\uff1e
\n\u30fbrbenv\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8(git pull\u306b\u3088\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u6700\u65b0\u5316)
\n\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u691c\u7d22\u3059\u308b\u3002<\/p>\n

\r\ncd `rbenv root` && git pull\r\n<\/pre>\n

\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5f15\u6570\u306b\u8a2d\u5b9a\u3057\u3066\u5b9f\u884c\u3059\u308b\u3002<\/p>\n

\r\nbash install_new_ruby.sh 2.3.3\r\n<\/pre>\n

ndenv\u3067Node.js\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u524a\u9664\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)<\/h3>\n

\uff1c\u5b9f\u884c\u5185\u5bb9\uff1e
\n\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306eNode.js\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb
\n\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u4ee5\u5916\u306eNode.js\u306e\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb
\n\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u5229\u7528\u8a2d\u5b9a<\/p>\n

\r\nvim install_new_node.sh\r\n<\/pre>\n
\r\n#!\/bin\/bash\r\n\r\nWORK_DIR=\/tmp\r\n\r\nNEW_VER=$1\r\n\r\nif [ "${NEW_VER}" = "" ]; then\r\n  echo "Input Target Version."\r\n  exit 1\r\nfi\r\n\r\nNDENVPATH=`ndenv root`\r\necho $NDENVPATH\r\ncd $NDENVPATH\r\ngit pull\r\ncd ${WORK_DIR}\r\n\r\nIS_VER=`ndenv install -l | grep "${NEW_VER}$" | wc -l`\r\n\r\nif [ "${IS_VER}" = "0" ]; then\r\n  echo "Target Version is not Exists."\r\n  exit 1\r\nfi\r\n\r\nndenv install ${NEW_VER}\r\nndenv global ${NEW_VER}\r\nndenv rehash\r\n\r\nNODES=`ls -1 $NDENVPATH\/versions | grep -v ${NEW_VER}`\r\nfor node in $NODES; do\r\n  echo '---------------------------------------'\r\n  echo $node\r\n  ndenv uninstall $node\r\ndone\r\n\r\nndenv global ${NEW_VER}\r\nndenv rehash\r\n\r\nrm -f ~\/.node-version\r\n\r\n<\/pre>\n

\uff1c\u5b9f\u884c\u4f8b\uff1e
\n\u30fbndenv\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8(git pull\u306b\u3088\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u6700\u65b0\u5316)
\n\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u691c\u7d22\u3059\u308b\u3002<\/p>\n

\r\ncd `ndenv root` && git pull\r\nndenv install -l\r\n<\/pre>\n

\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5f15\u6570\u306b\u8a2d\u5b9a\u3057\u3066\u5b9f\u884c\u3059\u308b\u3002<\/p>\n

\r\nbash install_new_node.sh v6.9.2\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

AWS\u306eAmazon EC2\u306b\u304a\u3044\u3066Amazon Linux\u3084CentOS\u306a\u3069\u3092\u7528\u3044\u3066\u30b5\u30fc\u30d0\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u88c5\u3059\u308b\u969b\u306b\u30b7\u30b9\u30c6\u30e0\u8981\u4ef6\u3067\u4f7f\u7528\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u6307\u5b9a\u30fb\u9650\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3082\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002 \u305d […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[3,22,90,79,80,89,82],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts\/2349"}],"collection":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/comments?post=2349"}],"version-history":[{"count":10,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts\/2349\/revisions"}],"predecessor-version":[{"id":5368,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts\/2349\/revisions\/5368"}],"wp:attachment":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/media?parent=2349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/categories?post=2349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/tags?post=2349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}