These are the steps for setting up your development environment for WebSiteOne (WSO) project. This covers the tools you need to have installed and any specific configuration(s).
We use git for version control and keep the project repository on GitHub. You'll need to be able to use both of those.
You'll do your development work on your own copy of the project.
[Additional Notes for installation on: c9, ubuntu, osx ]
-
On GitHub, fork AgileVentures/WebSiteOne into your own GitHub area.
-
Clone your fork to your local development machine (or where-ever you are going to do your development coding). To clone the fork, run the following command on your local machine:
git clone https://github.com/<your-github-name>/WebsiteOne
If you need more information about git and GitHub, see this general guide to getting set up with an AgileVentures project (use https://github.com/AgileVentures/WebsiteOne as the project URL).
You should now have the entire project -- all of the directories and files -- on your local machine, and it should have a git
repository (.git
).
When you've finished working on you changes, create a pull request (PR) on GitHub. Here are detailed insttructions on how to create a pull request for WSO.
The whole process of doing a PR and getting it reviewed and merged into this project is described in CONTRIBUTING.md.
- Clone your fork:
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
- Add remote from original repository in your forked repository:
cd into/cloned/fork-repo
git remote add upstream https://github.com/AgileVentures/WebsiteOne.git
git fetch upstream
- Updating your fork from original repo to keep up with WebsiteOne:
git pull upstream develop
See the Docker Project Setup documentation
bundle install
Note: On OSX El Capitan and above, you may get this error:
An error occurred while installing eventmachine (1.0.7), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.0.7'` succeeds before bundling.
If you then try to install the eventmachine
gem, it also fails like this: eventmachine/eventmachine#643.
That's because OpenSSL is no longer distributed with OS X. So you may need to use brew to set up OpenSSL:
brew link openssl --force
After you do that, re-try running bundle install
and you should be good to go on to the next step.
The database used is postgreSQL. You need to have this installed and running on your local machine.
(The pg
gem accesses the postgreSQL database.) Here are instructions on installing postgreSQL.
The capybara-webkit
gem is used for testing and depends on QT tools and libraries, including libqtwebkit
. Here are some tips and troubleshooting solutions if you have trouble installing the capybara-webkit
gem.
If you need to update rails, you can run bundle update rails
. If you run into problems with rails and libv8
on OS X, try this:
gem uninstall libv8
brew install v8
gem install therubyracer
gem install libv8 -v '3.16.14.3' -- --with-system-v8
-
Use npm to install all of the javascript dependencies for WSO:
npm install
-
Use npm to ensure bower is installed:
npm install bower
Phantomjs is used to run tests. Here are detailed instructions for installing it.
- You'll have to get the
.env
file from one of the admins: @tansaku or @diraulo. The project won't work without it. You can send them a direct message (DM) on Slack. The.env
file should go in the root of the WSO project. - Add the following to that file:
RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
RECAPTCHA_SECRET_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
AIRBRAKE_API_KEY=blahblahblah
AIRBRAKE_PROJECT_ID=123
SECRET_KEY_BASE=blabla
RACK_TIMEOUT_SERVICE_TIMEOUT=200000000
the above are test keys from https://developers.google.com/recaptcha/docs/faq
-
Run the rake command to set up the database. Be sure to use
bundle exec
so that the gems specific to this project (listed in the Gemfile) are used:bundle exec rake db:setup
Now you're ready to run the tests:
bundle exec rake spec
bundle exec rake jasmine:ci
bundle exec rake cucumber
Discuss any errors with the team on Slack, in a scrum, or in mob or pair programming.
bundle exec rails s
You can now see the system working on your local development environment!
Be sure to read and understand how to contribute when you're ready to start developing and contributing.
We recommend and follow the Ruby Style Guide
Here are notes about comments and altering other's code.
[Note: This page originally at https://github.com/AgileVentures/WebsiteOne/wiki/Project-Setup-%28New-Users%29]