This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Mac Installation Instructions
mulcahyk edited this page Mar 9, 2016
·
36 revisions
- Download and install xcode and xcode developer tools – without them, nothing works
- Install xcode from the Mac App Store: https://itunes.apple.com/us/app/xcode/id497799835?mt=12
xcode-select --install
[sudo] xcodebuild -license accept
- If needed, setup http_proxies in your bash profile (~/.profile)
export http_proxy="[proxy]"
export https_proxy="[proxy]"
export HTTP_PROXY="[proxy]"
export HTTPS_PROXY="[proxy]"
export no_proxy="localhost,127.0.0.1"
export NO_PROXY="localhost,127.0.0.1"
- Install homebrew: http://brew.sh/
brew link openssl --force
- Install mongodb using homebrew
brew install https://raw.githubusercontent.com/Homebrew/homebrew/e766380092dfd523f05b8e79e7ffb0bb85a43161/Library/Formula/mongodb.rb
- NOTE: brew install mongodb would normally work, but there is an issue with mongo version 3.0.7
- Follow instructions for starting mongo db on launch and immediately. Should look something like:
- For starting on reboot:
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents/
- For starting immediately:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
-
Install gpg: https://gpgtools.org
-
Install RVM: https://rvm.io/
- Make sure you install so ruby is included:
\curl -sSL https://get.rvm.io | bash -s stable --ruby
-
Restart terminal
-
(Optional) install git bash-completion tools
brew install git bash-completion
- Add the following to ~/.bash_profile
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
- Install bonnie
mkdir git
cd git
git clone https://github.com/projecttacoma/bonnie.git
cd bonnie
gem install eventmachine -v '1.0.7'
bundle install
- (If this doesn’t work, do
gem install bundler
)
- Set up the database
bundle exec rake db:setup
- Make a temp directory in ~/git/bonnie
mkdir tmp
- Turn on the BONNIE demo database
bundle exec rake bonnie:db:reset DEMO=true
- Open the mongo shell and switch to the bonnie_development database:
mongo
show dbs
- Should get back:
bonnie_development 0.078GB
local 0.078GB
- If you don’t see this result, try in various orders starting the mongo db and calling the
bundle exec rake
commands use bonnie_development
- Open the rails shell:
bundle exec rails console
User.last
- Should not be
nil
. - If you get nil, try in various orders starting the mongo db and calling the bundle exec rake commands
- Start the web server:
bundle exec rails server
- BONNIE should be available at
http://localhost:3000
- Log in
- The package comes with one user account:
- User: [email protected]
- Pass: b0nn13
- To make any user an admin, open the rails console (bundle exec rails console) and use the following:
User.first.update_attributes approved: true, admin: true
- Replace User.first with any user you would like to make admin, e.g. User.where(email:/\w/).first
- Pull down a few more items from project Tacoma and project Cypress
cd ~/git
git clone https://github.com/projecttacoma/hqmf2js.git
git clone https://github.com/projectcypress/health-data-standards.git
- (optional) download and install Atom
- In Atom, add your BONNIE directory as a project * File > Add Project Folder
- Turn off the auto whitespace trimmer (it creates unnecessary diff lines)
- File > Preferences > Packages
- Search for ‘whitespace’ and disable it
- If working with local copies of libraries like hqmf2js or health-data-standards
-
In /Gemfile, set up BONNIE to pull hqmf2js and health-data-standards from your local environment rather than git
- Comment out:
gem 'health-data-standards', :git => 'https://github.com/projectcypress/health-data-standards.git', :branch => 'master' gem 'hqmf2js', :git => 'https://github.com/projecttacoma/hqmf2js.git', :branch => 'master'
- Uncomment:
# gem 'health-data-standards', :path => '../health-data-standards' # gem 'hqmf2js', path: '../hqmf2js'
- Helpful web browser console commands
-
bonnie.mainView.getView().model.attributes
– this gets the attributes of the model of the current view, which should be super helpful for discovering data inconsistencies - In the chrome developer console (option + command + I)
- Sources tab > assets has all of the rendered items for this page (helpful to figure out how everything fits together)
- Using the Development db is great, because stuff is not minified like it is for the production db
- Get the original repository
git clone %%github address%%
- Check out a new branch (mostly for creating bugfixes or new features)
git checkout -b %%some new branch name%%
- Check out an existing branch
git checkout %%some existing branch name%%
- Figure out the status of your local repository
git status
- Commit a change to your local repo
git commit -a –m “%%some commit message%%”
- Push the change to github
git push origin %%some existing branch name%%
- Go back to master
git checkout master