instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.58k stars 2.48k forks source link

Delayed job init script fails with bundler gem resolution error #2091

Closed dreoliv closed 2 years ago

dreoliv commented 2 years ago

Summary:

After following the Production Start, I get the error below when running sudo /etc/init.d/canvas_init start:

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 2.2)

    rails (= 6.1.4.6) was resolved to 6.1.4.6, which depends on
      bundler (>= 1.15.0)

  Current Bundler version:
    bundler (2.1.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (~> 2.2)', which is required by gem 'rails (= 6.1.4.6)', in any of the relevant sources:
  the local ruby installation

It works if I change the last line of script/canvas_init to:

# run delayed jobs
exec bundle exec script/delayed_job $@

Should running script/delayed_job with bundle exec be the default?

I'm using Canvas version stable/2022-08-17 if that helps.

Ardena commented 2 years ago

Looks like the version of Rails 6.1 requires bundler 2.2. Our production start guide says to run this: sudo gem install bundler --version 2.2.19 --default before trying to run canvas_init. Looks like you have a slightly older version.

jimfangx commented 1 year ago

for those stumbling across this issue in the future: here's what worked for me:

use https://www.linode.com/docs/guides/install-canvas-lms-on-ubuntu-2004 for apache stuff use the guide in the wiki on the canvas lms github up until you start configuring the .ymls use https://www.linode.com/docs/guides/install-canvas-lms-on-ubuntu-2004 again for .ymls, getting SSL cert, etc.