ruby Openid 兼容库
我正在使用 ruby openid 兼容库,所以我可以成为 openid 消费者,我得到了示例,当我尝试启动该服务时,它显示错误,
/var/lib/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:163:in `ensure_session_key': A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb (ArgumentError)
from /var/lib/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:74:in `initialize'
任何想法都会受到赞赏,谢谢
I'm using ruby openid compliant library so I can be an openid consumer, I got the sample and when I try to start-up the service, it show errors like
/var/lib/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:163:in `ensure_session_key': A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb (ArgumentError)
from /var/lib/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:74:in `initialize'
any idea would be appreciated, thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对红宝石一无所知,但我强烈怀疑你需要改变这两件事。
1可能应该是一个会话ID(我不知道如何获取它)。 理论上2可以不予处理,但这并不是什么秘密。
I don't know anything about ruby but I strongly suspect you need to change these two things.
1 should probably be a session id (How to get this in I have no idea). 2 could in theory be left alone but it's not very secret then.
刚刚遇到同样的错误。 虽然错误消息(在 ruby 中经常发生)有点混乱,但它准确地告诉了您要做什么:将这段代码放入
config/environment.rb
中。具体来说,将其放在
Rails::Initializer.run do |config|
块中。Just faced the same error. Although error message (as it often happens with ruby) is a bit messy, it says you exactly what to do: put that piece of code inside
config/environment.rb
.To be specific, put it inside
Rails::Initializer.run do |config|
block.