Skip to content

Contributing

Joel Graycar edited this page Nov 24, 2015 · 8 revisions

If you're thinking of contributing to the development of the website, this is the page for you! These steps assume you're a member of the Cal Raijin Taiko GitHub organization, though there aren't too many differences if you're not. (A brief outline: fork the repo, set up the upstream remote, and then submit pull requests when you've got something.)

Initial Setup

First things first: you'll only be able to work on the website using a Mac or Linux machine. Sorry PC lovers! As far as I know, Windows doesn't support the most recent versions of Ruby, so you're out of luck. That being said, you could always run a Linux VirtualBox if you really wanted to (instructions).

Now, if you're on a Mac, things should be even easier for you. From the root repo level, you should be able to just run

bin/setup

and have everything set itself up for you. If something goes wrong with that though, or you're on a Linux machine, here are the step-by-step directions:

Installing Dependencies

  1. Install rvm by following these instructions

  2. Install the correct version of ruby:

    rvm install ruby-2.2.0
    rvm use ruby-2.2.0

    to download ruby v2.2.0 and begin using it.

    Note: if you encounter the error

    RVM is not a function, selecting rubies with 'rvm use ...' will not work
    

    try running the commands

    source ~/.rvm/scripts/rvm
    type rvm | head -n 1

    If that outputs rvm is a function, then run the command

    echo [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc

    And you should be all good! If you're getting this problem on Ubuntu, try following these instructions

  3. Install Bundler by running the command gem install bundler

  4. Install Imagemagick:

    On Mac:

    Install Homebrew with the following command:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    Once Homebrew is installed, run

    brew install imagemagick

    On Ubuntu:

    sudo apt-get install imagemagick

Setting up your local version of the website

  1. Clone the repo:

    Navigate into the directory where you'll want the project to live, then run the command

    git clone [email protected]:calraijintaiko/caltaiko.git
  2. Navigate into the caltaiko directory:

    cd caltaiko
  3. Run the command

    bundle install --without production

    to install all of the project's gems

  4. Run the command

    overcommit --install

    to set up the Git hooks that enforce styling before allowing you to commit changes.

  5. Run the commands

    rake db:schema:load
    rake db:seed

    to set up the test and development databases, as well as populate them with some fake data.

And now you're (basically) all set! You should be able to run

rails s

to begin running the web server; once you've done this, open up any browser, go to the url localhost:3000 and see the app running on your local machine!

When you ran the command rake db:seed you created a user for the site with username admin and password secret, so if you want to see how the admin interface looks, go to localhost:3000/login, login with those credentials, and check it out.