我正在尝试在 Apache 上设置 Rails 应用。
我正在使用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格式。
答案 0 :(得分:1)