-
-
Save robjshaw/4980676 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get homebrew http://mxcl.github.com/homebrew/ | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
# use homebrew to install rbenv and ruby-build | |
brew update | |
brew install rbenv | |
brew install ruby-build | |
# view available rubies | |
rbenv install --list | |
# fetch a ruby | |
rbenv install 1.9.3-p385 | |
# bind global | |
rbenv global 1.9.3-p385 | |
# install bundler | |
gem install bundler | |
# reset shims | |
rbenv rehash | |
# verify version | |
ruby --version | |
# create ~/.bundle/config and put the following in it to create a default bundle binary compile path as [projectdir]/vendor/bundle/bin: | |
--- | |
BUNDLE_PATH: vendor/bundle | |
BUNDLE_BIN: vendor/bundle/bin | |
# Add the following to ~/.bash_profile (create the file if missing): | |
eval "$(rbenv init -)" | |
# add some easy terminal alias for bundler calls | |
alias b="bundle exec" | |
alias bi="bundle install --without production" | |
# add bundler binstubs to the path so relative binarys are auto run from a project dir | |
export PATH="./vendor/bundle/bin:$PATH" | |
# install pow (with apache proxy! so you can work alongside existing apache projects) | |
https://github.com/37signals/pow/wiki/Running-Pow-with-Apache | |
# install pow util, anvil | |
http://anvilformac.com/ | |
# install rails | |
rbenv shell 1.9.3-p385 | |
gem install rails | |
# rebuild global binary proxies | |
rbenv rehash | |
# now you can cd to your base project folder and create new rails project (optionally with mysql) | |
rails new projectname --database=mysql | |
# set default rails version for project, creates .rbenv-version | |
cd projectpath | |
rbenv local 1.9.3-p385 | |
# run bundler install to fetch all the gems | |
bi | |
# symlink the project directory to ~/.pow | |
cd ~/.pow | |
ln -s projectpath | |
# view local app | |
http://projectpath.dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment