【发布时间】:2019-06-06 09:19:55
【问题描述】:
我是 capistrano 和 ruby 的新手,当我使用 cap deploy 时,我遇到了一些错误。我尝试升级我的 ruby 版本和io-console,但它们都没有帮助我解决我的问题。有人可以帮我解决吗?
在我的错误日志下方:
/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>'```
【问题讨论】:
-
“我已经尝试升级我的 ruby 版本” - 可能是您服务器的 Ruby 版本有问题。
cap deploy是立即退出还是在部署过程中出现错误?后者表示远程端有问题。 -
您尝试部署什么? Ruby on Rails 应用程序?你使用捆绑器吗?您的应用程序是否包含
Gemfile和Gemfile.lock?是否在您的开发计算机上更新了 Ruby?在服务器上?
标签: ruby capistrano