Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SyntaxError on the welcome to rails screen using Pow

I have just set up a new project which displays all the correct info in the about your applications environment window when on http://localhost:3000/ but when I run it at http://egg.dev/ I get:

SyntaxError: /users/davidhall/work/egg/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end
...sion_store :cookie_store, key: '_egg_session'
                              ^

I'm sure I had this problem earlier, which was due to me using rails 3.1 with ruby 1.8.7, the problem resolved when I used ruby 1.9.2. Now I'm getting when using 1.9.2 too.

Thanks for any help its much appreciated!

like image 620
Dave Avatar asked Aug 19 '11 22:08

Dave


2 Answers

The Problem is that, there is a new-style hash argument available in Ruby1.9.2 but unavailable in Ruby1.8.7 which is

key: value  # only available in 1.9.2
    ||
:key => value # available in 1.8.7 and 1.9.2

so, with a less effort, you can just modify the syntax to the one that 1.8.7 recognized.

like image 55
Yuanfei Zhu Avatar answered Sep 21 '22 22:09

Yuanfei Zhu


As you can read in the Pow User's Manual under point 2.3 you have to add a .rvmrc into the root directory of your project with the content rvm 1.9.2. Then it should work!

like image 20
Daniel Spangenberg Avatar answered Sep 23 '22 22:09

Daniel Spangenberg