参考官方网址:https://github.com/instructure/canvas-lms/wiki/Upgrading
进入代码安装目录,如果未修改过官方的代码(除配置文件),可直接执行:
sudo git fetch && git reset --hard origin/stable
有修改需处理冲突或覆盖本地代码。
同时更新analytics、rce源码; 检查ruby,yarn,npm版本是否符合最新版要求,可以看下Production Start。
sudo bundle update
sudo bundle install
如果出错,
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
➜ 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,记得备份,是否可以删除?
sudo yarn install --ignore-engines
sudo RAILS_ENV=production bundle exec rake canvas:compile_assets
sudo RAILS_ENV=production bundle exec rake db:migrate:predeploy
sudo RAILS_ENV=production bundle exec rake db:migrate
db migrate某个rb出错,移出去了,跑一遍,报错,再放回去,跑,通过了。。 如果是在上一个版本之前的rb,觉得删除也无所谓。
sudo RAILS_ENV=production bundle exec rake db:load_notifications
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/canvas_init restart
script/delayed_job restart
安装之后变成了目录,于是重新安装了sudo a2enmod passenger
,然后正常
rce更新备份.env文件,删除rce目录,重新拉取
更新后发现所有的icon图标都出问题了,编译也正常,删除/var/canvas/public/dis
t目录,重新执行编译:
sudo RAILS_ENV=production bundle exec rake canvas:compile_assets