尝试设置webistrano并收到以下错误:
rake db:migrate
(in /var/www/html/webistrano)
rake aborted!
/var/www/html/webistrano/vendor/rails/activesupport/lib/active_support/inflector.rb:273: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n'
when 1: "#{number}st"
^
/var/www/html/webistrano/vendor/rails/activesupport/lib/active_support/inflector.rb:274: syntax error, unexpected keyword_when, expecting keyword_end
when 2: "#{number}nd"
^
/var/www/html/webistrano/vendor/rails/activesupport/lib/active_support/inflector.rb:275: syntax error, unexpected keyword_when, expecting keyword_end
when 3: "#{number}rd"
^
/var/www/html/webistrano/vendor/rails/activesupport/lib/active_support/inflector.rb:280: syntax error, unexpected keyword_end, expecting $end
答案 0 :(得分:2)
检查ruby语法是否有类似开关的语句,在when之后没有“:”。
case foo
when "bar"
# do stuff
when "bar2"
# do other stuff
end
另一方面,你为什么要这样做呢?如果我正确阅读了您的代码,也许您应该看一下ordinalize方法。