ruby Openid 兼容库

发布于 2024-07-25 04:10:07 字数 560 浏览 10 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

落花随流水 2024-08-01 04:10:08

我对红宝石一无所知,但我强烈怀疑你需要改变这两件事。

  1. “_myapp_session”
  2. “一些秘密短语”

1可能应该是一个会话ID(我不知道如何获取它)。 理论上2可以不予处理,但这并不是什么秘密。

I don't know anything about ruby but I strongly suspect you need to change these two things.

  1. "_myapp_session"
  2. "some secret phrase"

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.

究竟谁懂我的在乎 2024-08-01 04:10:08

刚刚遇到同样的错误。 虽然错误消息(在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文