Q:

Rails console does not start on ubuntu 12.04

i am using rails server without any problem ubuntu 12.04. But I wanna try some methods at console on terminal and i use 
rails console

command. but it does not work. The output is here:
/var/lib/gems/1.8/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:245:in `load': /home/mehmet/www/tutorial/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError)
...sion_store :cookie_store, key: '_tutorial_session'
                              ^
    from /var/lib/gems/1.8/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:245:in `load'
    from /var/lib/gems/1.8/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /var/lib/gems/1.8/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:245:in `load'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/engine.rb:588
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/engine.rb:587:in `each'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/engine.rb:587
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `instance_exec'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `run'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:55:in `run_initializers'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `each'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `run_initializers'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/application.rb:136:in `initialize!'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `send'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/mehmet/www/tutorial/config/environment.rb:5
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/application.rb:103:in `require'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/application.rb:103:in `require_environment!'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/commands.rb:40
    from script/rails:6:in `require'
    from script/rails:6
mehmet@vefanet:~/www/tutorial$ rails console
/var/lib/gems/1.8/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:245:in `load': /home/mehmet/www/tutorial/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError)
...sion_store :cookie_store, key: '_tutorial_session'
                              ^
    from /var/lib/gems/1.8/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:245:in `load'
    from /var/lib/gems/1.8/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /var/lib/gems/1.8/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:245:in `load'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/engine.rb:588
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/engine.rb:587:in `each'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/engine.rb:587
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `instance_exec'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `run'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:55:in `run_initializers'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `each'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `run_initializers'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/application.rb:136:in `initialize!'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `send'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/mehmet/www/tutorial/config/environment.rb:5
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/application.rb:103:in `require'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/application.rb:103:in `require_environment!'
    from /var/lib/gems/1.8/gems/railties-3.2.9/lib/rails/commands.rb:40
    from script/rails:6:in `require'
    from script/rails:6

So, do you have any idea. What should i do?

A:

It looks like the problematic file uses the new hash syntax introduced with ruby 1.9. It looks like you are running the app with ruby 1.8 though.
1.) You could install and use ruby 1.9
2.) You could change the hash syntax of the file. Rails 3.2.9 should run with ruby 1.8.7 so hopefully this is the only problematic area.
The difference in the hash syntax is:
1.9
{key: 'value'}

1.8
{:key => 'value'}

