Canvas网络教学平台-升级

参考官方网址:https://github.com/instructure/canvas-lms/wiki/Upgrading

1. Canvas Upgrade(更新代码)

进入代码安装目录,如果未修改过官方的代码(除配置文件),可直接执行:

sudo git fetch && git reset --hard origin/stable

有修改需处理冲突或覆盖本地代码。

同时更新analytics、rce源码;
检查ruby,yarn,npm版本是否符合最新版要求,可以看下Production Start。

2. Upgrade and Install Bundled Gems(更新和安装依赖库)

sudo bundle update

sudo bundle install

如果出错,

error1:

Your Ruby version is 2.4.9, but your Gemfile specified >= 2.6.0, < 3.1

升级Ruby到指定版本,
参考:

https://blog.csdn.net/weixin_41287260/article/details/103072951
https://segmentfault.com/q/1010000000476329

还需要重新安装bundle,执行:sudo gem install bundler

error2:

➜  canvas git:(stable) ✗ sudo bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/.......
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
You have requested:
  rails = 5.1.6.2

The bundle currently has rails locked at 5.1.6.1.
Try running `bundle update rails`

If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`

安装相应的依赖sudo bundle update rails,然后执行sudo bundle install
如果插件版本报错,修改的gemfile.lock,记得备份,是否可以删除?

3. Upgrade and Install Node Modules(更新和安装Node模块)

sudo yarn install --ignore-engines

4. Compiled Assets(编译)

sudo RAILS_ENV=production bundle exec rake canvas:compile_assets

5. Database migrations(数据库迁移)

sudo RAILS_ENV=production bundle exec rake db:migrate:predeploy
sudo RAILS_ENV=production bundle exec rake db:migrate

db migrate某个rb出错,移出去了,跑一遍,报错,再放回去,跑,通过了。。
如果是在上一个版本之前的rb,觉得删除也无所谓。

6. Notification types(更新通知)

sudo RAILS_ENV=production bundle exec rake db:load_notifications

7. 重启

sudo /etc/init.d/apache2 restart
sudo /etc/init.d/canvas_init restart
script/delayed_job restart

安装之后变成了目录,于是重新安装了sudo a2enmod passenger ,然后正常

rce更新备份.env文件,删除rce目录,重新拉取

8. 意外发现

更新后发现所有的icon图标都出问题了,编译也正常,删除/var/canvas/public/dist目录,重新执行编译:

sudo RAILS_ENV=production bundle exec rake canvas:compile_assets

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值