instructure / canvas-lms

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

Gemfile syntax error failure when compiling on prod #2222

Closed jama211 closed 1 year ago

jama211 commented 1 year ago

Summary:

Ever since https://github.com/instructure/canvas-lms/commit/92c7eae8b03cc8ebe355d2fed4efe0ab8a90271d, cannot compile using bundle. The following error is given, it seems empty arguments are not allowed by ruby 2.X - but ruby 2.X is still recommended for installation (NOTE: I was using https://github.com/instructure/canvas-lms/wiki/Production-Start, if this guide is outdated and ruby 3X is now recommended this could be incorrect):

jamie@Ubuntu-22:~/canvas-lms$ bundle _2.3.26_ install

[!] There was an error parsing `Gemfile`: syntax error, unexpected ',' -                    current:,
                           ^
/home/jamie/canvas-lms/Gemfile:48: syntax error, unexpected ',', expecting `end'
...SUPPORTED_RAILS_VERSIONS.first,
...                              ^
/home/jamie/canvas-lms/Gemfile:85: syntax error, unexpected ','
...   super(name, *version, path:, **kwargs)
...                              ^
/home/jamie/canvas-lms/Gemfile:99: syntax error, unexpected end-of-input, expecting `end'. Bundler cannot continue.

 #  from /home/jamie/canvas-lms/Gemfile:46
 #  -------------------------------------------
 #        add_lockfile(lockfile,
 >                     current:,
 #                     prepare:,
 #  -------------------------------------------

NOTE: Reverting to the prior commit b546d3a2d91a134a2cb7cc624d3e6e56b3a741ce, and installing:

sudo apt-get install libldap2-dev sudo apt-get install libidn11-dev

resolves this issue and allows compiling

Steps to reproduce:

  1. Checkout latest prod
  2. Install prereqs as usual
  3. Attempt to run the following as per the install guide:
    sysadmin@appserver:/var/canvas$ sudo gem install bundler --version 2.3.26
    sysadmin@appserver:/var/canvas$ bundle config set --local path vendor/bundle
    sysadmin@appserver:/var/canvas$ bundle install

Expected behavior:

Canvas compiles

Actual behavior:

Syntax error in Gemfile

Additional notes:

NOTE: Reverting to the prior commit b546d3a2d91a134a2cb7cc624d3e6e56b3a741ce resolves this issue and allows compiling

jama211 commented 1 year ago

Nevermind, the latest guide recommends "Canvas now recommends Ruby 3.1, as of the 2021-11-10 release. Ruby 3.1+ support is untested." https://github.com/instructure/canvas-lms/wiki/Production-Start#dependency-installation - so it was a problem with the linode guide specifically. Closing this issue but leaving it here in case it is helpful to anyone else.