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

(Naveed Ahmad) #1

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:
discourse (11e303e)

(Sam Saffron) #2

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

(Naveed Ahmad) #3

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

(cpradio) #4

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.

(Robin Ward) #5

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

(Rafael dos Santos Silva) #6

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

(Naveed Ahmad) #7

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

(Rafael dos Santos Silva) #8

Doesn’t a simple:

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


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).

(cpradio) #9

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

(Alan Tan) #10

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.

(Alan Tan) #11

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 

(Alan Tan) #12

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

(Naveed Ahmad) #13
cd/ var/discourse
git pull
./launcher rebuild app

Did the trick. Thanks :slight_smile:

(Jeff Atwood) #14