1

RailsアプリをApacheにセットアップしようとしています。Passenger を使用してRails Appをロードしています。Passengerは新しい Ruby ハッシュ形式をサポートしていないようですx: yが、古いものはサポートしているよう:x => yです。私が使用しているRubyのバージョンは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 形式に変換したくありません。

4

1 に答える 1

1

あなたの乗客は Ruby 1.8.x を使用していると思います。

乗客をバージョン 3.2 に切り替えて、この Rails アプリに 1.9.3 を使用していることを確認してください。

参照: https://serverfault.com/a/388821

于 2012-10-28T10:40:08.550 に答える