2010-09-22 136 views
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 

回答

2

檢查類似開關的statments紅寶石語法,沒有「:」後時。

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

在旁註中,爲什麼你要這樣做?如果我正確地閱讀了你的代碼,也許你應該看看ordinalize方法。