Gustin Tang
Gustin Tang

Reputation: 85

Why do I get syntax errors when I deploy capistrano?

I'm new with capistrano and ruby and when I use cap deploy, I get some errors. I've tried to upgrade my ruby version and io-console, but none of them helped me to resolve my problem. Could someone help me resolving it?

Below my error log:

/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require': /usr/local/share/ruby/gems/2.0/gems/i18n-1.6.0/lib/i18n/exceptions.rb:20: syntax error, unexpected <<, expecting ')' (SyntaxError)
      super(<<~MESSAGE)
              ^
/usr/local/share/ruby/gems/2.0/gems/i18n-1.6.0/lib/i18n/exceptions.rb:23: syntax error, unexpected keyword_in, expecting keyword_end
...hod is meant to display text in the user locale, so calling ...
...                               ^
/usr/local/share/ruby/gems/2.0/gems/i18n-1.6.0/lib/i18n/exceptions.rb:23: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
... in the user locale, so calling it before the user locale has
...                               ^
/usr/local/share/ruby/gems/2.0/gems/i18n-1.6.0/lib/i18n/exceptions.rb:26: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
...tside of the user flow, you can do so by passing
...                               ^
/usr/local/share/ruby/gems/2.0/gems/i18n-1.6.0/lib/i18n/exceptions.rb:27: syntax error, unexpected tIDENTIFIER, expecting keyword_end
...ctly with the `locale` argument, e.g. `I18n.#{method}(..., l...
...                               ^
/usr/local/share/ruby/gems/2.0/gems/i18n-1.6.0/lib/i18n/exceptions.rb:27: syntax error, unexpected tCONSTANT, expecting :: or '[' or '.'
...e `locale` argument, e.g. `I18n.#{method}(..., locale: :en)`
...                               ^
        from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/share/ruby/gems/2.0/gems/i18n-1.6.0/lib/i18n.rb:6:in `<top (required)>'
        from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/share/ruby/gems/2.0/gems/capistrano-3.11.0/lib/capistrano/i18n.rb:1:in `<top (required)>'
        from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/share/ruby/gems/2.0/gems/capistrano-3.11.0/lib/capistrano/all.rb:10:in `<top (required)>'
        from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/share/ruby/gems/2.0/gems/capistrano-3.11.0/bin/cap:2:in `<top (required)>'
        from /usr/local/bin/cap:23:in `load'
        from /usr/local/bin/cap:23:in `<main>'```


Upvotes: 0

Views: 298

Answers (1)

spickermann
spickermann

Reputation: 107107

The path of your error message looks like you are using Ruby 2.0 and version 1.6.0 of the i18n gem. The i18n gem uses the squiggly heredoc syntax (<<~) in that version. The syntax was introduced in Ruby 2.3.

That means you have two options:

  • Update your Ruby version to at least 2.3 or
  • downgrade the i18n. 1.5.1 seems to be the latest version that doesn't depend on Ruby 2.3

Upvotes: 4

Related Questions