我刚刚开始使用 Rails,我已经第二次启动我的服务器,但我收到以下错误消息?我也没有修改 /config/initializers 中的任何 Ruby 文件。
george@ubuntu:~/Desktop/blog$ rails server
=> Booting WEBrick
=> Rails 3.2.8 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.2.8/lib/active_support/dependencies.rb:245:in `load': /home/george/Desktop/blog/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError)
...sion_store :cookie_store, key: '_blog_session'
^
from /var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
from /var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/lib/gems/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/engine.rb:588
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/engine.rb:587:in `each'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/engine.rb:587
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `send'
from /var/lib/gems/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/george/Desktop/blog/config/environment.rb:5
from /home/george/Desktop/blog/config.ru:4:in `require'
from /home/george/Desktop/blog/config.ru:4
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /var/lib/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /home/george/Desktop/blog/config.ru:1:in `new'
from /home/george/Desktop/blog/config.ru:1
config/initializers/session_store 的内容如下。
# Be sure to restart your server when you modify this file.
Blog::Application.config.session_store :cookie_store, key: '_blog_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# Blog::Application.config.session_store :active_record_store