-1

我正在阅读 RailsTutorial,我被困在测试驱动开发部分。

当我打电话时

$ rails generate integration_test static_pages

    SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
    This poses a security threat. It is strongly recommended that you
    provide a secret to prevent exploits that may be possible from crafted
    cookies. This will not be supported in future versions of Rack, and
    future versions will even invalidate your existing user cookies.

    Called from: /Users/Marcus/.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd/gems/actionpack-3.2.3/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.

我在运行时收到了类似的错误

$ rails server


Marcuss-MacBook-Pro-2:public Marcus$ rails s
=> Booting WEBrick
=> Rails 3.2.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
    SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
    This poses a security threat. It is strongly recommended that you
    provide a secret to prevent exploits that may be possible from crafted
    cookies. This will not be supported in future versions of Rack, and
    future versions will even invalidate your existing user cookies.

    Called from: /Users/Marcus/.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd/gems/actionpack-3.2.3/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.

服务器将运行,但会发生此错误。有谁知道如何解决这个问题?

谢谢 - 如果您需要更多信息,请告诉我。

4

2 回答 2

5

看起来您正在使用 Rails 3.2.3。此问题已在 Rails 3.2.11 中修复。将 Rails 升级到 3.2 系列的最新版本(当前为 3.2.15)将解决此问题,并保护您免受一些严重的安全漏洞的影响,这些漏洞在高于您正在使用的版本中已修复。

于 2013-11-15T02:08:11.320 回答
-1

此安全警告是在 2013 年 1 月 6 日在 ruby​​gems.org 上发布的机架 1.4.2 中引入的。它不会改变您在应用程序上的工作,因此最好忽略它。

于 2013-11-07T09:04:00.173 回答