Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Setting up your local environment

Kevin Yaroch edited this page Sep 23, 2015 · 1 revision

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.

####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:

Instructions

  1. Clone the repository locally, and change to the working directory.

     git clone https://github.com/MozillaHive/HiveCHI-rwm.git
     cd HiveCHI-rwm
    
  2. Install the correct version of Ruby. Using rbenv:

     rbenv install
     rbenv rehash
    
  3. Install Bundler.

     gem install bundler
     rbenv rehash
    
  4. Use Bundler to set up the required gems.

     bundle install
     rbenv rehash
    
  5. Now set up the database (if this doesn't work, there are detailed instructions for configuring Postgres here).

     rake db:create
     rake db:migrate
    
  6. Seed the database with test data.

     rake db:seed
    
  7. Fill in config/application.yml. Twilio test credentials should be available here. If you encounter issues with these, set PHONE_VERIFICATION to DISABLED and you will still be able to register new user accounts.

  8. Now you can run the tests with

     bundle exec rspec
    
  9. Finally, start the server.

     rails s
    
  10. If everything went right, the application should now be running locally at http://localhost:3000/.

  11. If the ruby version is ever updated, rerun these steps to install the new version:

    rbenv install
    gem install bundler
    bundle install
    
Clone this wiki locally