Rake db:迁移语法错误

发布于 2024-09-24 07:39:51 字数 859 浏览 1 评论 0原文

尝试设置 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执笔绘流年 2024-10-01 07:39:51

检查 ruby​​ 语法中类似 switch 的语句,when 后面没有“:”。

case foo
  when "bar"
    # do stuff
  when "bar2"
    # do other stuff
end

顺便说一句,你为什么要这样做?如果我正确地阅读了您的代码,也许您应该看看 ordinalize 方法。

Check the ruby syntax for switch-like statments, there is no ":" after the when.

case foo
  when "bar"
    # do stuff
  when "bar2"
    # do other stuff
end

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文