Canvas is an open source Learning Management System (LMS) developed by Instructure. Canvas caught my attention when it was released two years ago primarily because it was developed using Ruby and Ruby on Rails. As of this posting, it’s still using Rails 2.3.x and Ruby 1.8.
When it just so happened that I would actually need an LMS as part of another project that I was working on last December, I jumped at the opportunity to try Canvas. Part of acquainting myself with that codebase involved setting up the project and all of its system dependencies based on Canvas’s own Quick Start Guide. To ease some of the configuration burden of that guide I’ve recorded the setup in a Vagrant based virtual machine environment using VirtualBox that I’ve now released on GitHub.
To get started, you will first need to make sure you have both VirtualBox and Vagrant installed. Once you have those setup, installing the Canvas development environment is just a handful of commands:
host $ git clone https://github.com/jhuckabee/canvas-lms-dev-box.git host $ cd canvas-lms-dev-box host $ git submodule init host $ git clone https://github.com/instructure/canvas-lms.git host $ vagrant up
On my machine this takes about 5 minutes to complete. So be patient. Once its done, you will have a 32-bit, Ubuntu 12.04 virtual machine with everything you need to run Canvas.
If you’re not familiar with Vagrant you should be aware of the fact that it automatically mounts the root directory of the canvas-lms-dev-box project to
/vagrant in the virtual machine. This allows you edit files locally while running everything from within the virtual machine itself.
If you want to take Canvas for a spin, continue with the following. First you will need to ssh into your new virtual machine.
host $ vagrant ssh
This will log you in to the VM. Proceed with the database setup (this will prompt you for the initial account details) and asset compilation, and then you will be ready to start the web server.
vagrant $ cd /vagrant/canvas-lms vagrant $ bundle exec rake db:initial_setup vagrant $ bundle exec rake canvas:compile_assets vagrant $ bundle exec script/server
These will take another 5 minutes to complete. Once the server is running, you will be able to access the site from you browser at http://localhost:3000/. Use the account details you supplied to the
db:initial_setup rake task to login.
That’s it. You now have a shiny new Canvas installation at your disposal.
It should be noted that this project was inspired by Rails’s own rails-dev-box project. So a special thanks goes to the Rails team for making that tool available.