2012-10-28 32 views
1

我想設置我的Rails應用程序Apache。 我使用乘客來加載我的Rails應用程序。好像乘客不支持新的紅寶石散列格式x: y,但支持舊的:x => y。我使用Ruby版本是1.9.3Ruby 1.9.3中的乘客錯誤哈希¶

這是錯誤消息我得到:

categories_controller.rb:12: syntax error, unexpected ':', expecting '}' format.json { render json: @categories } 
categories_controller.rb:23: syntax error, unexpected ':', expecting '}' format.json { render json: @category } 
categories_controller.rb:34: syntax error, unexpected ':', expecting '}' format.json { render json: @category } 
categories_controller.rb:50: syntax error, unexpected ':', expecting '}' ...redirect_to @category, notice: 'Category was successfully cr... 
categories_controller.rb:51: syntax error, unexpected ':', expecting '}' ... format.json { render json: @category, status: :created, ... 
categories_controller.rb:51: syntax error, unexpected ':', expecting '=' ...ender json: @category, status: :created, location: @category... 
categories_controller.rb:53: syntax error, unexpected ':', expecting '}' format.html { render action: "new" } 
categories_controller.rb:54: syntax error, unexpected ':', expecting '}' ... format.json { render json: @category.errors, status: :un... 
categories_controller.rb:54: syntax error, unexpected ':', expecting '=' ...son: @category.errors, status: :unprocessable_entity } 
categories_controller.rb:66: syntax error, unexpected ':', expecting '}' ...redirect_to @category, notice: 'Category was successfully up... 
categories_controller.rb:69: syntax error, unexpected ':', expecting '}' format.html { render action: "edit" } 
categories_controller.rb:70: syntax error, unexpected ':', expecting '}' ... format.json { render json: @category.errors, status: :un... 
categories_controller.rb:70: syntax error, unexpected ':', expecting '=' ...son: @category.errors, status: :unprocessable_entity } 

有沒有解決有關此。我不想將所有散列轉換爲:x => y格式。

+0

什麼讓你覺得乘客使用Ruby 1.9.3? –

+0

因爲當我將哈希格式更改爲:x => y時,它工作正常。這發生在我使用紅寶石1.8.7時。但使用1.9.3,哈希格式的格式爲:x y。所以我唯一的猜測是因爲ruby版本。 – premprakash

+0

所以顯然乘客使用1.8,但你需要它使用1.9.3。再說一次,爲什麼你會認爲Passenger會使用1.9,當它顯然沒有使用1.9時。 –

回答

1

我想你的乘客正在使用Ruby 1.8.x.

將您的乘客切換至3.2版本,以確保您使用的是1.9.3版本的此應用程序。

參考:https://serverfault.com/a/388821

+0

是否有任何地方的乘客3.2的安裝說明? – premprakash