This manual describes a complete procedure how to install and run Cabot on OS X for development. It was tested on OS X 10.9.1 and Cabot version 2014-01-23.
We’re using Homebrew to install the required dependencies on OS X. If you don’t have Homebrew yet (how is that possible? ;), see http://brew.sh/ for an installation script. Note: MacPorts can be probably used too, but we didn’t test it.
Although you can use Python and Ruby that comes with OS X, it’s better to use Python installed via Homebrew and use rbenv to manage Rubies. Then you don’t need to use sudo
and mess up your system. If you’re already using rvm instead of rbenv, then stay with it and skip the rbenv installation steps.
Make sure that Homebrew is up to date:
brew update
If you have Python via Homebrew, rbenv (or rvm) and npm already installed and configured, then simply skip these steps.
Install Python 2.7 via Homebrew:
brew install python
Make sure that you have the right Python and pip binaries on your PATH:
which python
>>> /usr/local/bin/python
which pip
>>> /usr/local/bin/pip
Install rbenv:
brew install rbenv ruby-build
Add rbenv init
into your ~/.bash_profile
and open a new terminal (to reload your profile):
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
If you’re using the fish shell instead of bash, then add these lines to your ~/.config/fish/config.fish
and open a new terminal (to reload your configuration):
set -x PATH $HOME/.rbenv/bin $PATH
set -x PATH $HOME/.rbenv/shims $PATH
rbenv rehash >/dev/null ^&1
Install Ruby and set it as default:
rbenv install 2.1.0
rbenv global 2.1.0
Make sure that you have the right Ruby and gem binaries on your PATH:
which ruby
>>> /Users/$USER/.rbenv/shims/ruby
which gem
>>> /Users/$USER/.rbenv/shims/gem
Install node:
brew install node
Add npm/bin
to your PATH:
echo 'PATH=/usr/local/share/npm/bin:$PATH' >> ~/.bash_profile
… or if your using the fish shell, then:
echo 'set -x PATH /usr/local/share/npm/bin $PATH' >> ~/.config/fish/config.fish
Install the required dependencies of Cabot:
brew install libxml2 libxslt redis
Install the foreman gem:
gem install foreman
Install coffee-script and less compilers:
npm install -g coffee-script [email protected] --registry http://registry.npmjs.org/
Install virtualenv for Python:
pip install virtualenv
Clone the Cabot repository:
git clone https://github.com/arachnys/cabot.git
cd cabot
Configure the development profile:
cp conf/development.env.example conf/development.env
sed -i 's/:yourrediskey@//' conf/development.env
Create a new Python environment for Cabot and activate it:
virtualenv venv
source venv/bin/activate # or activate.fish
Install the dependencies:
pip install -r requirements.txt --exists-action=w
If it fails with complaint that it can’t find argparse
, then install it manually and rerun the previous command:
pip install argparse --no-index -f http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz
Populate a testing SQLite database; it should ask you to create a superuser account:
source bin/activate # or activate.fish
./setup_dev.sh
If fails due to an encoding problem, then do the following and rerun ./setup_dev.sh
:
rm dev.db
export LC_ALL=en_US.UTF.8
That’s all folks, now you can start your Cabol instance.
Don’t forget to source these two files to setup your environment (or their .fish
equivalent):
source venv/bin/activate; source bin/activate
Then start an embedded server:
foreman start
…and open http://localhost:5001 in your browser.