rails 3.1 key value problem
rails 3.1 with ruby 1.9.2p290 on windows generates
initialers/config/session_store.rb
Hello::Application.config.session_store :cookie_store, key: '_hello_session'
key: 'hello_session'
开发者_运维百科 is :key => 'hello_session'
in some of my old apps. What makes rails to generate different codes? Ruby version or rails version ?
There's a new hash syntax in ruby 1.9, you can write:
{key: "hello_session"}
instead of:
{:key => "hello_session"}
The 1.8 syntax is still supported, use it if you want your app to be compatible with both 1.8 and 1.9.
I resolved this by removing my ~/.rvm directory and reinstalling RVM.
精彩评论