I have been using rails on Windows for some time, and I decided to try it on Linux recently. Therefore, I set everything up, but now the project that I created on the windows does not work properly on ubuntu: it cannot interpret the following syntax:
render json: @products
Produce the following error:
/home/dcastro/workspace/teste/app/controllers/products_controller.rb:9: syntax error, unexpected ':', expecting '}' format.json { render json: @products } ^ /home/dcastro/workspace/teste/app/controllers/products_controller.rb:20: syntax error, unexpected ':', expecting '}' format.json { render json: @product }
And it only works if I change it:
render :json => @products
At first I thought it was because I was using an older version of ruby ββ(namely, 1.8.7). So I installed 1.9.2p290, but that didn't work.
If that matters, I use rails 3.1.0 and ubuntu 11.04.
Does anyone know what causes this? And how can I fix this? Thanks in advance!
source share