# שגיאה בתחביר Ruby 3.2 בהתקנה רגילה

**URL:** <https://meta.discourse.org/t/error-on-ruby-3-2-syntax-on-standard-install/270491>\
**Category:** Bug\
**Created:** [4 ביולי,‏ 2023,‏ 9:15am UTC](https://meta.discourse.org/t/error-on-ruby-3-2-syntax-on-standard-install/270491 "2023-07-04T09:15:59Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![sigmike](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sigmike/32/117797_2.png) [@sigmike](https://meta.discourse.org/u/sigmike)\
**Post date:** [4 ביולי,‏ 2023,‏ 9:15am UTC](https://meta.discourse.org/t/error-on-ruby-3-2-syntax-on-standard-install/270491/1 "2023-07-04T09:15:59Z")

</div>

I had the same error as [this message](https://meta.discourse.org/t/pre-compilation-error-version-3-0-4/268914/1) on a [standard install](https://meta.discourse.org/t/142537?silent=true) during an upgrade from the browser. The error happened during the `plugin:pull_compatible_all` and `multisite:migrate` operations though, not the assets precompile.

The error:

```plaintext
SyntaxError: /var/www/discourse/lib/file_store/base_store.rb:96: syntax error, unexpected ','
      download(*, **, print_deprecation: false)

```

The complete upgrade log copied from the UI in the browser:

```plaintext
********************************************************
 ***Please be patient, next steps might take a while***
 ********************************************************
Cycling Unicorn, to free up memory
Restarting unicorn pid: 559
Waiting for Unicorn to reload.
Waiting for Unicorn to reload..
Waiting for Unicorn to reload...
Waiting for Unicorn to reload....
Waiting for Unicorn to reload.....
Waiting for Unicorn to reload......
Waiting for Unicorn to reload.......
Waiting for Unicorn to reload........
Stopping 1 Unicorn worker(s), to free up memory
Stopping job queue to reclaim memory, master pid is 15009
$ cd /var/www/discourse && git fetch --tags --force && git reset --hard HEAD@{upstream}
Using openssl-signature_algorithm 1.2.1
Using aws-sigv4 1.5.0
Using faraday 2.7.2
Using image_optim 0.31.2
Using request_store 1.5.1
Using logstash-logger 0.26.1
Using message_bus 4.3.1
Using mini_racer 0.6.3
Using sidekiq 6.5.8
Using mini_suffix 0.3.3
Using oauth-tty 1.0.5
Using snaky_hash 2.0.1
Using omniauth 1.9.2
Using pry 0.14.2
Using puma 6.0.2
Using rack-mini-profiler 3.0.0
Using rack-protection 3.0.5
Using rbtrace 0.4.14
Using redis-namespace 1.9.0
Using rqrcode 2.1.2
Using rss 0.2.9
Using sassc 2.0.1
Using sprockets 3.7.2
Using uglifier 4.2.0
Using unf 0.1.4
Using unicorn 6.1.0
Using web-push 3.0.0
Using loofah 2.19.1
Using net-imap 0.3.1
Using net-pop 0.1.2
Using net-smtp 0.3.3
Using cose 1.3.0
Using css_parser 1.13.0
Using ruby-readability 0.7.0
Using sanitize 6.0.0
Using ecma-re-validator 0.4.0
Using activesupport 7.0.4.3
Using rails-html-sanitizer 1.5.0
Using globalid 1.0.1
Using activemodel 7.0.4.3
Using aws-sdk-core 3.130.2
Using faraday-retry 2.0.0
Using json_schemer 0.2.23
Using mini_scheduler 0.15.0
Using oauth 1.1.0
Using oauth2 1.4.11
Using pry-byebug 3.10.1
Using pry-rails 0.3.9
Using rails-dom-testing 2.0.3
Using actionview 7.0.4.3
Using activejob 7.0.4.3
Using active_model_serializers 0.8.4
Using activerecord 7.0.4.3
Using aws-sdk-kms 1.56.0
Using aws-sdk-sns 1.53.0
Using omniauth-oauth2 1.7.3
Using omniauth-oauth 1.2.0
Using actionpack 7.0.4.3
Using actionview_precompiler 0.2.3
Using aws-sdk-s3 1.114.0
Using discourse-seed-fu 2.3.12
Using omniauth-facebook 9.0.0
Using omniauth-github 1.4.0
Using omniauth-google-oauth2 0.8.2
Using omniauth-twitter 1.4.0
Using railties 7.0.4.3
Using sprockets-rails 3.4.2
Using mail 2.8.0.edge from https://github.com/discourse/mail.git (at main@5b700fc)
Using lograge 0.12.0
Using rails_failover 0.8.1
Using rails_multisite 4.0.1
Using sassc-rails 2.1.2
Using actionmailer 7.0.4.3
Installing uri 0.12.2
Using net-http 0.3.2
Bundle complete! 135 Gemfile dependencies, 171 gems now installed.
Gems in the groups 'test' and 'development' were not installed.
Bundled gems are installed into `./vendor/bundle`
$ yarn install --production
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ yarn --cwd app/assets/javascripts/discourse $(node -e 'if(JSON.parse(process.env.npm_config_argv).original.includes(`--frozen-lockfile`)){console.log(`--frozen-lockfile`)}')
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 8.84s.
Done in 9.31s.
$ LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all
rake aborted!
SyntaxError: /var/www/discourse/lib/file_store/base_store.rb:96: syntax error, unexpected ','
      download(*, **, print_deprecation: false)
                ^
/var/www/discourse/lib/file_store/base_store.rb:102: syntax error, unexpected ','
      download(*, **, print_deprecation: false)
                ^
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
/var/www/discourse/lib/file_store/local_store.rb:3:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
/var/www/discourse/lib/tasks/posts.rake:3:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:661:in `load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:661:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:661:in `each'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:661:in `run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/application.rb:506:in `run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:464:in `load_tasks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/railtie.rb:226:in `public_send'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/railtie.rb:226:in `method_missing'
/var/www/discourse/Rakefile:9:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/bin/bundle:25:in `load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)
Unable checkout compatible plugin versions
$ SKIP_POST_DEPLOYMENT_MIGRATIONS=1 bundle exec rake multisite:migrate
rake aborted!
SyntaxError: /var/www/discourse/lib/file_store/base_store.rb:96: syntax error, unexpected ','
      download(*, **, print_deprecation: false)
                ^
/var/www/discourse/lib/file_store/base_store.rb:102: syntax error, unexpected ','
      download(*, **, print_deprecation: false)
                ^
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
/var/www/discourse/lib/file_store/local_store.rb:3:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
/var/www/discourse/lib/tasks/posts.rake:3:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:661:in `load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:661:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:661:in `each'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:661:in `run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/application.rb:506:in `run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/engine.rb:464:in `load_tasks'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/railtie.rb:226:in `public_send'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/railtie.rb:226:in `method_missing'
/var/www/discourse/Rakefile:9:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/bin/bundle:25:in `load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)
Docker Manager: FAILED TO UPGRADE
#<RuntimeError: RuntimeError>
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:209:in `run'
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:101:in `upgrade'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:19:in `block in <main>'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `fork'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/commands/runner/runner_command.rb:43:in `load'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/commands/runner/runner_command.rb:43:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/command.rb:48:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/var/www/discourse/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
bin/rails:18:in `<main>'
Spinning up 1 Unicorn worker(s) that were stopped initially

```

Running the upgrade from the console (`git pull && ./launcher rebuild app`, as mentioned [here](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md#9-post-install-maintenance)) triggered another error, but I’m not sure what’s the relevant error message here:

```plaintext
I, [2023-07-04T08:08:49.261121 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
- Building
- Building
- building...
- cleaning up
- cleaning up
Build Error (broccoli-persistent-filter:Babel > [Babel: @ember/test-helpers]) in @ember/test-helpers/-internal/build-registry.js

[BABEL]: --- PLACEHOLDER PACKAGE ---
This @babel/plugin-proposal-private-property-in-object version is not meant to
be imported. Something is importing
@babel/plugin-proposal-private-property-in-object without declaring it in its
dependencies (or devDependencies) in the package.json file.
Add "@babel/plugin-proposal-private-property-in-object" to your devDependencies
to work around this error. This will make this message go away.
 (While processing: /var/www/discourse/app/assets/javascripts/node_modules/@babel/preset-env/lib/index.js)Error: [BABEL]: --- PLACEHOLDER PACKAGE ---
This @babel/plugin-proposal-private-property-in-object version is not meant to
be imported. Something is importing
@babel/plugin-proposal-private-property-in-object without declaring it in its
dependencies (or devDependencies) in the package.json file.
Add "@babel/plugin-proposal-private-property-in-object" to your devDependencies
to work around this error. This will make this message go away.
 (While processing: /var/www/discourse/app/assets/javascripts/node_modules/@babel/preset-env/lib/index.js)
    at Object.<anonymous> (/var/www/discourse/app/assets/javascripts/node_modules/@babel/preset-env/node_modules/@babel/plugin-proposal-private-property-in-object/lib/index.js:28:7)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/var/www/discourse/app/assets/javascripts/node_modules/@babel/preset-env/lib/available-plugins.js:62:46)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/var/www/discourse/app/assets/javascripts/node_modules/@babel/preset-env/lib/filter-items.js:11:25)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/var/www/discourse/app/assets/javascripts/node_modules/@babel/preset-env/lib/index.js:16:20)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)

Stack Trace and Error Report: /tmp/error.dump.5abe6326cd5a415063a7ad1c85649486.log
error Command failed with exit code 1.
I, [2023-07-04T08:09:05.088181 #1] INFO -- : Checking 'Video Upload' for 'default'... up to date
yarn run v1.22.19
$ /var/www/discourse/app/assets/javascripts/node_modules/.bin/ember build -prod
WARNING: Node v18.16.1 is not tested against Ember CLI on your platform. We recommend that you use the most-recent "Active LTS" version of Node.js. See https://git.io/v7S5n for details.
Environment: production
cleaning up...
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I, [2023-07-04T08:09:05.089002 #1] INFO -- : Terminating async processes
I, [2023-07-04T08:09:05.089274 #1] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 42
103:signal-handler (1688458145) Received SIGTERM scheduling shutdown...
I, [2023-07-04T08:09:05.089522 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 103
2023-07-04 08:09:05.089 UTC [42] LOG: received fast shutdown request
103:M 04 Jul 2023 08:09:05.183 # User requested shutdown...
103:M 04 Jul 2023 08:09:05.183 * Saving the final RDB snapshot before exiting.
2023-07-04 08:09:05.186 UTC [42] LOG: aborting any active transactions
2023-07-04 08:09:05.190 UTC [42] LOG: background worker "logical replication launcher" (PID 51) exited with exit code 1
2023-07-04 08:09:05.190 UTC [46] LOG: shutting down
103:M 04 Jul 2023 08:09:05.388 * DB saved on disk
103:M 04 Jul 2023 08:09:05.389 # Redis is now ready to exit, bye bye...
2023-07-04 08:09:05.431 UTC [42] LOG: database system is shut down

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 2323 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
bootstrap failed with exit code 1
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
f1dc57af807a68bb877ce724ea4a3424c77d39250b8ee20cb022194938925ce8

```

I reverted to the commit I had before the `git pull` (cdc5f905a2f245171b9f53fb76f4ba947389fc6b) and rebuilt again and got the same error.

I tried `./discourse-doctor` and it failed on the same babel error. It said the installation uses unofficial plugins and suggests I disable them, but how can I do that without a working app? All the plugins have been installed from the browser interface, not in app.yaml.

When I restart the app I get an `Oops - Error 500` in the browser. When I enter the app, `/var/www/discourse/log/production.log` gives the same Syntax Error, and the ruby version is indeed 3.1 (`ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]`).

The forum is broken now. How can I fix the ruby version? Or the rebuild? Or revert to a working app?

My `app.yml` with the comments removed and the identifiers redacted:

```yaml
templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ssl.template.yml"
  - "templates/web.letsencrypt.ssl.template.yml"
  - "templates/sshd.template.yml"
  - "templates/web.ratelimited.template.yml"

expose:
  - "80:80"
  - "443:443"
  - "2222:22"

params:
  db_default_text_search_config: "pg_catalog.english"
  db_shared_buffers: "128MB"
  version: stable

env:
  LANG: en_US.UTF-8
  UNICORN_WORKERS: 2
  DISCOURSE_DEVELOPER_EMAILS: 'redacted'
  DISCOURSE_HOSTNAME: 'redacted'
  DISCOURSE_SMTP_ADDRESS: "redacted"
  DISCOURSE_SMTP_PORT: 25
  DISCOURSE_SMTP_USER_NAME: "redacted"
  DISCOURSE_SMTP_PASSWORD: "redacted"
  DISCOURSE_SMTP_ENABLE_START_TLS: true
  LETSENCRYPT_ACCOUNT_EMAIL: "redacted"
  DISCOURSE_MAXMIND_LICENSE_KEY: "redacted"
  DISCOURSE_REFRESH_MAXMIND_DB_DURING_PRECOMPILE_DAYS: 0

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git

run:
  - exec: echo "Beginning of custom commands"

  - exec: echo "End of custom commands"
  - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'

```

---

_[View the full topic](https://meta.discourse.org/t/error-on-ruby-3-2-syntax-on-standard-install/270491)._
