Rake db:迁移语法错误
尝试设置 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
trying to setup webistrano and getting the following error:
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查 ruby 语法中类似 switch 的语句,when 后面没有“:”。
顺便说一句,你为什么要这样做?如果我正确地阅读了您的代码,也许您应该看看 ordinalize 方法。
Check the ruby syntax for switch-like statments, there is no ":" after the when.
On a side note, why are you trying to do it like this? If I read your code correctly, maybe you should take a look at the ordinalize method.