Failed to upgrade - syntax error, unexpected << js << <<~JS

Trying to upgrade discourse to latest version, but before that I need to upgrade docker manager and
getting following exception while upgrading:

Bundled gems are installed into ./vendor/bundle.
$ bundle exec rake multisite:migrate
rake aborted!
SyntaxError: /var/www/discourse/lib/plugin/instance.rb:273: syntax error, unexpected <<
      js << <<~JS
              ^
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:457:in `load'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:457:in `block in load_file'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:647:in `new_constants_in'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:456:in `load_file'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:354:in `require_or_load'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:317:in `depend_on'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:233:in `require_dependency'
/var/www/discourse/lib/discourse.rb:2:in `'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:274:in `require'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:274:in `block in require'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:274:in `require'
/var/www/discourse/config/application.rb:31:in `'
/var/www/discourse/config/application.rb:19:in `'
/var/www/discourse/config/application.rb:18:in `'
/var/www/discourse/Rakefile:5:in `require'
/var/www/discourse/Rakefile:5:in `'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-11.2.2/exe/rake:27:in `'
(See full trace by running task with --trace)

Current versions:
docker_manager(9b59950)
discourse (11e303e)

Are you 100% sure you are not running any plugins except for docker_manager?

Sorry I should have included list of other plugins as well, using following plugins:

You are probably better off letting it upgrade all of them by logging into the server and running

./launcher rebuild app

Especially if you are following tests-pased, as a lot of those plugins have had changes due to recent Core changes.

「いいね!」 1

The problem here is the ruby 2.3 syntax - @tgxworld told it was safe to use, but perhaps it is not?

「いいね!」 3

The guy isn’t running the latest docker image, the latest enforce ruby 2.3.

Yeah and I’m getting this exception while upgrading docker_manager.

Doesn’t a simple:

cd/ var/discourse
git pull
./launcher rebuild app

works?

The docker manager isn’t used to update the launcher, and is need on the big transition upgrade (ruby, pg, nginx, etc update from earlier this month).

「いいね!」 5

That was my questioning too. In theory, I would think that would solve his issue.

「いいね!」 2

Hmmm this is odd. I added a check to make docker manager raise an error and make the user rebuild if Ruby is not 2.3. Will have a look next week.

「いいね!」 3

Hmm I can’t find a <<~JS ` heredoc anywhere (including your plugins).

Have you resolved the issue?

Otherwise, can you run the following commands and provide the output here?

./launcher enter app
ruby -v 
cat /VERSION
「いいね!」 4

Ah I found it but the syntax we’re using is different and I’m not sure how to reproduce yet.

https://github.com/discourse/discourse/blob/master/lib/plugin/instance.rb#L249-L266

「いいね!」 2
cd/ var/discourse
git pull
./launcher rebuild app

Did the trick. Thanks :slight_smile:

「いいね!」 2