Skip to content

Instantly share code, notes, and snippets.

@dannysmith
Last active November 9, 2024 13:52
Show Gist options
  • Save dannysmith/9780920 to your computer and use it in GitHub Desktop.
Save dannysmith/9780920 to your computer and use it in GitHub Desktop.
Installing Canvas LMS
# Download the source
git clone https://github.com/instructure/canvas-lms.git canvas
cd canvas
git checkout --track -b stable origin/stable
rbenv install –keep 1.9.3-p545
rbenv local 1.9.3-p545
brew install xmlsec1 postgresql
bundle install
# If you get this error: No source for ruby-1.9.3-p545 provided with debugger-ruby_core_source gem.
# If you don’t have sources, install with ‘–keep’ option
rbenv install –keep 1.9.3-p545
gem install debugger-linecache -v '1.1.2' -- –with-ruby-include=$HOME/.rbenv/sources/1.9.3-p545/1.9.3-p545
bundle install
# If you still have errors, try:
cd $(gem contents debugger-ruby_core_source)
gem install archive tempdir archive-tar-minitar
rake add_source VERSION=1.9.3-p545
#See: http://sponsorpay.github.io/blog/2012/06/11/ruby-debugger-and-no-source-for-ruby-error/
cd ~/Dropbox/dev/canvas
gem install debugger-ruby_core_source
bundle install
# Set up Data
for config in amazon_s3 delayed_jobs domain file_store outgoing_mail security scribd external_migration; \
do cp config/$config.yml.example config/$config.yml; done
cp config/database.yml.example config/database.yml
export PGHOST=localhost # Also add this to your .bash_profile
#Start Postgres
initdb /usr/local/var/postgres -E utf8
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
# If you get an error, list the current pg tables with: psql -U danny -l
# Create databases
createdb canvas_development
createdb canvas_queue_development
createdb canvas_test
bundle exec rake db:initial_setup
psql -c 'CREATE USER canvas' -d canvas_test
psql -c 'GRANT ALL PRIVILEGES ON DATABASE canvas_test TO canvas' -d canvas_test
psql -c 'GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO canvas' -d canvas_test
psql -c 'GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO canvas' -d canvas_test
RAILS_ENV=test bundle exec rake db:test:reset
# File Generation
npm install
bundle exec rake canvas:compile_assets
# Speed up by installing redis
brew install redis
redis-server /usr/local/etc/redis.conf
echo -e "development:\n cache_store: redis_store" > config/cache_store.yml
echo -e "development:\n servers:\n - redis://localhost" > config/redis.yml
# Run the tests
bundle exec rake spec
# Run the App
bundle exec script/server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment