This guide is intended for those who want to get a version of Canvas LMS running as quickly as possible (e.g. For a development environment).
Crucial 16gb kit 8gbx2 ddr3l 1600 sodimm memory for mac. The environment produced by this guide is lacking in several features (e.g., ) and is not suitable for production use. See the guide for instructions on standing up a production-ready system.
If you need help installing Canvas or troubleshooting your installation, your best bet is to join the community mailing list or the IRC channel (see the page) and ask specific questions there. It's likely that somebody else has already tackled the same problem. Note that a common category of questions are those that stem from following this guide instead of the guide.
If you are sure that you want to continue with the Quick Start guide, read on. Setup Automated Setup If you are running macOS or Ubuntu, you can clone the repository and run the script to automatically setup a development environment with./script/dockerdevsetup.sh Manual Setup This tutorial is targeting POSIX-based systems like macOS and Linux. This tutorial was written and tested using Ubuntu's latest LTS 18.04.1, macOS 10.14 Mojave, and Debian 9.5 Stretch. If you have a different system, consider setting up a server or virtual machine running the latest.
We'll assume you've either done so or are familiar with these working parts enough to do translations yourself. Getting the code There are two primary ways to get a copy of Canvas: git or zip/tar download. Using Git If you don't already have, you can install it on Debian/Ubuntu by running $ sudo apt-get install git Once you have a copy of Git installed on your system, getting the latest source for Canvas is as simple as checking out code from the repo, like so: $ git clone canvas $ cd canvas $ git checkout stable Using a Tarball or a Zip Download You can also download a tarball or zip file. Application root Wherever you check out the code to, we're going to call that your application root. The application root is the folder that has folders such as app, config, and script. For the purposes of this tutorial, we'll assume your application root is /home/user/canvas. Dependency Installation Canvas requires Ruby 2.4 or greater.
A minimum version of 2.4.4 is recommended. External Dependencies Debian/Ubuntu We now need to install the Ruby libraries and packages that Canvas needs. On Debian/Ubuntu, there are a few packages you're going to need to install. If you're running Ubuntu 14.04 Trusty, you'll need to add a PPA in order to get Ruby 2.4: $ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:brightbox/ruby-ng $ sudo apt-get update $ sudo apt-get install ruby2.4 ruby2.4-dev zlib1g-dev libxml2-dev libsqlite3-dev postgresql-9.5 libpq-dev libxmlsec1-dev curl make g Note: In Ubuntu, in case you encounter any error such as E: Package 'postgresql-9.5' has no installation candidate, it may be because postgresql-9.5 is not available in that Ubuntu version. See Node.js installation: $ curl -sL sudo -E bash - $ sudo apt-get install -y nodejs build-essential: $ curl -sS sudo apt-key add - $ echo 'deb stable main' sudo tee /etc/apt/sources.list.d/yarn.list $ sudo apt-get update && sudo apt-get install yarn=1.10.1-1 After installing Postgres, you will need to set your system username as a postgres superuser.
You can do so by running the following commands: sudo -u postgres createuser $USER sudo -u postgres psql -c 'alter user $USER with superuser' postgres macOS For macOS, you'll need to install the, and make sure you have Ruby 2.4. You can find out what version of Ruby your Mac came with by running: $ ruby -v You also need Postgres and the installed.
The easiest way to get these is via. Once you have homebrew installed, just run: $ brew install postgresql@9.5 nodejs xmlsec1 Ruby Gems Most of Canvas' dependencies are Ruby Gems. Ruby Gems are a Ruby-specific package management system that operates orthogonally to operating-system package management systems. Bundler Canvas uses Bundler as an additional layer on top of Ruby Gems to manage versioned dependencies. Bundler is great! You can install Bundler using Ruby Gems: $ gem install bundler -v 1.13.6 On Debian 8 Jessie, you'll need to substitute gem with gem2.4. Canvas Dependencies Once you have installed Bundler, please navigate to the Canvas application root, where you can install all of the Canvas dependencies using Bundler.
$ cd canvas /canvas$ bundle install /canvas$ yarn install -pure-lockfile # Sometimes you have to run this command twice if there is an error /canvas$ yarn install -pure-lockfile If you're on macOS Mavericks or macOS Yosemite and hit an error with the thrift gem, you might have to set the following bundler flag and then run bundle install again (see ): /canvas$ bundle config build.thrift -with-cppflags='-DFORTIFYSOURCE=0' If you are on El Capitan and encounter an error with the thrift gem that has something like the following in the text. Compactprotocol.c:431:41: error: shifting a negative signed value is undefined -Werror,-Wshift-negative-value Use the following command to install the gem and then continue with another bundle install. Gem install thrift -v 0.8.0 - -with-cppflags= '-DFORTIFYSOURCE=0 -Wno-shift-negative-value ' The problem is the clang got updated in El Capitan and some of the flags cause problems now on install for the old version of thrift. If you hit an error with the eventmachine gem, you might have to set the following bundler flag and then run bundle install again: /canvas$ bundle config build.eventmachine -with-cppflags=-I/usr/local/opt/openssl/include JavaScript Runtime You'll also need a JavaScript runtime to translate our CoffeeScript code to JavaScript and a few other things. We use Node.js for this. MacOS users can download the installer from.
Linux users should already have it from the apt-get install step above. CoffeeScript can be installed the same way as on other platforms, through npm (which is included with the nodeJS installation): $ sudo npm install -g coffee-script@1.6.2 Data setup Canvas default configuration Before we set up all the tables in your database, our Rails code depends on a small few configuration files, which ship with good example settings, so, we'll want to set those up quickly.
We'll be examining them more shortly. From the root of your Canvas tree, you can pull in the default configuration values like so: /canvas$ for config in amazons3 delayedjobs domain filestore outgoingmail security externalmigration; do cp -v config/$config.yml.example config/$config.yml; done Dynamic settings configuration This config file is useful if you don't want to run a consul cluster with canvas. Just provide the config data you would like for the DynamicSettings class to find, and it will use it whenever a call for consul data is issued. Data should be shaped like the example below, one key for the related set of data, and a hash of key/value pairs (no nesting) /canvas$ cp config/dynamicsettings.yml.example config/dynamicsettings.yml Database configuration Now we need to set up your database configuration. We have provided a sample file for quickstarts, so you just need to copy it in.
You'll also want to create two databases. Depending on your OS (i.e. On Linux), you may need to use a postgres user to create the database, and configure database.yml to use a specific username to connect. See the tutorial for details on doing that.
On macOS your local user will have permissions to create databases already, so no special configuration is necessary. /canvas$ cp config/database.yml.example config/database.yml /canvas$ createdb canvasdevelopment Note: When installing postgres with brew, you may have trouble connecting to the database and you may get an error like: /canvas$ createdb canvasdevelopment createdb: could not connect to database postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket '/var/pgsqlsocket/.s.PGSQL.5432'?
If you get a connection error when creating your databases, run the following and add it to your.bashprofile: export PGHOST=localhost If, after that, you get another error like: /canvas$ createdb canvasdevelopment createdb: could not connect to database template1: could not connect to server: Connection refused Is the server running on host 'localhost' (::1) and accepting TCP/IP connections on port 5432? Could not connect to server: Connection refused Is the server running on host 'localhost' (127.0.0.1) and accepting TCP/IP connections on port 5432? Could not connect to server: Connection refused Is the server running on host 'localhost' (fe80::1) and accepting TCP/IP connections on port 5432?
Then postgres may not be running. To start it: $ initdb /usr/local/var/postgres -E utf8 $ pgctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start Database population Once your database is configured, we need to actually fill the database with tables and initial data.