Mac OSX 10.11+

This page provides instructions on installing Autolab for development on Mac OSX 10.11+. If you encounter any issue along the way, check out Troubleshooting.

Follow the step-by-step instructions below:

  1. Install rbenv (use the Basic GitHub Checkout method)

  2. Install ruby-build as an rbenv plugin:

    git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
    

    Restart your shell at this point in order to start using your newly installed rbenv

  3. Clone the Autolab repo into home directory and enter it:

    cd ~/
    git clone https://github.com/autolab/Autolab.git && cd Autolab
    
  4. Install the correct version of ruby:

    rbenv install $(cat .ruby-version)
    

    At this point, confirm that rbenv is working (you might need to restart your shell):

    $ which ruby
    ~/.rbenv/shims/ruby
    
    $ which rake
    ~/.rbenv/shims/rake
    

    Note that Mac OSX comes with its own installation of ruby. You might need to switch your ruby from the system version to the rbenv installed version. One option is to add the following lines to ~/.bash_profile:

    export RBENV_ROOT=<rbenv folder path on your local machine>
    eval "$(rbenv init -)"
    
  5. Install bundler:

    gem install bundler
    rbenv rehash
    
  6. Install the required gems (run the following commands in the cloned Autolab repo):

    cd bin
    bundle install
    

    Refer to Troubleshooting for issues installing gems

  7. Install one of two database options

    • SQLite should only be used in development
    • MySQL can be used in development or production
  8. Configure your database:

    cp config/database.yml.template config/database.yml
    

    Edit database.yml with the correct credentials for your chosen database. Refer to Troubleshooting for any issues.

  9. Configure school/organization specific information (new feature):

    cp config/school.yml.template config/school.yml
    

    Edit school.yml with your school/organization specific names and emails

  10. Configure the Devise Auth System with a unique key (run these commands exactly - leave <YOUR-SECRET-KEY> as it is):

    cp config/initializers/devise.rb.template config/initializers/devise.rb
    sed -i "s/<YOUR-SECRET-KEY>/`bundle exec rails secret`/g" config/initializers/devise.rb
    

    Fill in <YOUR_WEBSITE> in the config/initializers/devise.rb file. To skip this step for now, fill with foo.bar.

  11. Create and initialize the database tables:

    bundle exec rails db:create
    bundle exec rails db:migrate
    

    Do not forget to use bundle exec in front of every rake/rails command.

  12. Create initial root user

    ./bin/initialize_user.sh
    
  13. Populate dummy data (for development only):

    bundle exec rails autolab:populate
    
  14. Start the rails server:

    bundle exec rails s -p 3000
    
  15. Go to localhost:3000 and login with either the credentials of the root user you just created, or choose Developer Login with:

    Email: "admin@foo.bar".
    
  16. Install Tango, the backend autograding service.

  17. Now you are all set to start using Autolab! Visit the Guide for Instructors and Guide for Lab Authors pages for more info.