The one I wrote for new students in the laboratory. Build an environment for version control of various scripting languages. Version control with pythonbrew, rvm, perlbrew, nvm, and package management with pip, gem, cpanm, npm.
For apps, read [Summary] Over 100 general-purpose tools that programmers who don't know will lose and put them in as appropriate.
Mac users go through the steps up to "installing homebrew". After that, you only have to do what you need. For other UNIX-like people, use yum or apt to prepare the necessary packages, and then do what you need after "Installing homebrew".
[]->[Software Update...]
Wait until the installation is complete
Download and install the latest version of Xcode for Lion from here
Start Xcode and select Command Line Tools from [Xcode]-> [Preferences]-> [Downloads] to install. Without this, homebrew can (very rarely) be weird.
Similarly, download and install the Java for OS X Developer Package
Do the following in the terminal
$ ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
$ brew install git
$ brew update
Requires git for version control of homebrew itself
If you are not particular about the shell
$ brew install zsh
If you haven't prepared .zshrc yourself before, you can add it.
$ curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
$ curl -kL http://xrl.us/pythonbrewinstall | bash
$ echo '[[ -s "${HOME}/.pythonbrew/etc/bashrc" ]] && source $HOME/.pythonbrew/etc/bashrc' >> ~/.zshrc
$ pybrew install -fn 2.7.2 3.2 #Takes time
If you want to create a virtualenv and isolate the package
$ pybrew venv create lab -p 2.7.2
$ pybrew venv create lab -p 3.2
This will create a virtualenv named lab
in python2.7.2 and 3.2 respectively. If you are not sure, I recommend you to make it for the time being, as it is likely that you will not regret it later.
$ pybrew switch 2.7.2
$ pybrew switch 3.2
The person who created virtualenv
$ pybrew venv use lab -p 2.7.2
$ pybrew venv use lab -p 3.2
Modules that you want to use across venv should be installed after turning off venv (see ipython installation)
Switch to the version you want to install with pybrew and then run
$ pip install PACKAGE_NAME
$ pybrew switch 2.7.2 #2 without venv.7.Move to 2
$ pip install ipython
$ pybrew venv use lab
launch ipython
$ ipython
Modules installed without venv can be referenced from all venv.
$ curl -L get.rvm.io | bash -s stable
$ echo '[[ -s "${HOME}/.rvm/scripts/rvm" ]] && source $HOME/.rvm/scripts/rvm' >> ~/.zshrc
$ rvm install 1.9.3 #Takes time
Isolate the environment using gemset. If you don't understand this, you should finally do it.
$ rvm use 1.9.3
$ rvm gemset create lab
$ rvm use 1.9.3@lab --default
There is a gemset named global, and the gems in it can be referenced by all other gemsets, so it's a good idea to put generic tools in global. (Refer to the item of pry installation)
Only for those who don't need documentation
$ echo 'gem: --no-ri --no-rdoc' >> ~/.gemrc
$ gem install PACKAGE_NAME
Interactive shell for ruby. It is necessary without depending on gemset, so put it in global
$ rvm use 1.9.3@global
$ gem install pry
$ rvm use 1.9.3@lab #return
To start
$ pry
By default perlbrew is installed in $ HOME / perl5 / perlbrew. If you don't like this
$ echo 'export PERLBREW_ROOT=$HOME/.perl5/perlbrew' >> .zshrc
$ source ~/.zshrc
$ curl -kL http://install.perlbrew.pl | bash
$ echo '[[ -s "${HOME}/.perl5/perlbrew/etc/bashrc" ]] && source $HOME/.perl5/perlbrew/etc/bashrc' >> ~/.zshrc
$ perlbrew install perl-5.14.2 #Takes time
$ perlbrew switch perl-5.14.2
$ perlbrew install-cpanm
$ git clone git://github.com/creationix/nvm.git ~/.nvm
$ echo '[[ -s "${HOME}/.nvm/nvm.sh" ]] && source $HOME/.nvm/nvm.sh' >> .zshrc
$ nvm install v0.6.15 #Takes time
$ nvm alias default v0.6.15
When you insert node with nvm, npm can be used automatically. By default, npm manages packages on a project-by-project basis, so you don't have to manage packages separately with gemset in rvm.
To install the package:
$ npm install PACKAGE_NAME
Doing this will create a directory called node_modules in the current directory. This node_moduels is referenced from all node projects under the current directory.
If you want to place it in a global location, add the -g option. CoffeeScript installation reference
$ npm install -g coffee-script
Recommended Posts