-
Notifications
You must be signed in to change notification settings - Fork 15
Setting up your local environment
##Try an IDE in the cloud This is the fastest way to get started. We recommend Cloud 9.
When creating a new workspace, copy this url into the "Clone from Git or Mercurial" text box: git@github.com:MozillaHive/HiveCHI-rwm.git
##Try using Vagrant You can use Vagrant to create a virtual machine that is preconfigured with all the software and settings you need to to work on this project. This is completely optional, and may not be worthwhile if you already have a Rails development environment mostly set up; however, it may be a good option if you're having trouble setting up your environment.
This Vagrant config was set up using railsbox.
####Requirements You will need VirtualBox, vagrant and ansible to be installed. ansible also requires Python and some Python modules to be installed.
- VirtualBox
- Vagrant
-
Ansible (Mac users:
brew install ansible
)
####Setup
cd /path/to/rails/project/railsbox/development
vagrant up
vagrant will download the base box and provision it with ansible using your configuration (this will take ~15-20 minutes if this is your first time using vagrant).
Note that vagrant may ask for a sudo password. That's required when you're using NFS for folder synchronization.
Once it's done, you'll be able to login into it using vagrant ssh
command.
The application is stored in /HiveCHI-rwm directory.
To start the app,
rails s -b0.0.0.0
The app can be hit locally on your machine at 192.168.20.50:3000/
##Setting up your environment locally To contribute without using a cloud IDE or vagrant, you'll need to do the following:
- Install Git.
- Install either RVM or rbenv.
- Use RVM or rbenv to install Ruby 2.1.2.
- Install the Bundler gem (
gem install bundler
). - Install Postgres and configure it so that Rails can connect properly. (The simplest way to install Postgres on OS X is to use Postgres.app. You can find detailed configuration instructions in this Slack post.)
More detailed setup instructions follow:
-
Clone the repository locally, and change to the working directory.
git clone https://github.com/MozillaHive/HiveCHI-rwm.git cd HiveCHI-rwm
-
Install the correct version of Ruby. Using rbenv:
rbenv install rbenv rehash
-
Install Bundler.
gem install bundler rbenv rehash
-
Use Bundler to set up the required gems.
bundle install rbenv rehash
-
Now set up the database (if this doesn't work, there are detailed instructions for configuring Postgres here).
rake db:create rake db:migrate
-
Seed the database with test data.
rake db:seed
-
Fill in
config/application.yml
. Twilio test credentials should be available here. If you encounter issues with these, setPHONE_VERIFICATION
toDISABLED
and you will still be able to register new user accounts. -
Now you can run the tests with
bundle exec rspec
-
Finally, start the server.
rails s
-
If everything went right, the application should now be running locally at http://localhost:3000/.
-
If the ruby version is ever updated, rerun these steps to install the new version:
rbenv install gem install bundler bundle install