2011-12-31 60 views
0

恐怕我有點傻的問題,但我沒能解決這個問題我自己:得到錯誤,同時啓動服務器Aptana3,回報率

[email protected]:~/Aptana Studio 3 Workspace/rails-test$ rails server 
=> Booting WEBrick 
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 
Exiting 
/var/lib/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `load': /home/alex/Aptana Studio 3 Workspace/rails-test/config/initializers/session_ 
store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError) 
...sion_store :cookie_store, key: => '_rails-test_session' 
          ^

回答

1

key: => '_rails-test_session'是無效的紅寶石。你可以做key => valuekey: value,但它們不能合併。

0

Ruby散列語法是updated in 1.9。現在,您可以像這樣創建散列:

hash = { 
    foo: "bar", 
    faz: "baz" 
} 

但你仍然可以使用舊的「散列火箭的風格:

hash = { 
    :foo => "bar", 
    :faz => "baz" 
} 

在兩種實現foofazsymbols

你的問題是key: => '_rails-test_session'是一個franken-hash,你試圖結合兩種樣式的散列。請使用key::key =>