6

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!

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
Dave
  • 1,175
  • 2
  • 21
  • 49

3 Answers3

33

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.

Yuanfei Zhu
  • 751
  • 5
  • 16
6

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!

0

I resolved this by deleting the ~/.rvm directory and reinstalling RVM.

Chris Kemp
  • 2,069
  • 2
  • 18
  • 27