从 WEBrick 到 Apache2 &乘客,在 SessionsController#create 中获得了 ActionController::InvalidAuthenticityToken
我刚刚将本地开发笔记本电脑从 WEBrick 更改为 Apache2/Passenger。现在我知道
ActionController::InvalidAuthenticityToken in SessionsController#create
我正在使用 红宝石 1.9.2 轨道2.3.8 ubuntu 10.04
我尝试了两者
protect_from_forgery, :only => [:update, :delete, :create]
,并且
skip_before_filter :verify_authenticity_token
在我的 applicaiton_controller.rb 中
它们似乎没有帮助。 (顺便说一句,我应该在修改 applicaiton_controller.rb 之后以某种方式重新启动 Passenger 吗?)
任何帮助将不胜感激。
I just changed in my local development laptop from WEBrick to Apache2/Passenger. Now I got
ActionController::InvalidAuthenticityToken in SessionsController#create
I'm using
Ruby 1.9.2
Rails 2.3.8
ubuntu 10.04
I tried both
protect_from_forgery, :only => [:update, :delete, :create]
and
skip_before_filter :verify_authenticity_token
in my applicaiton_controller.rb
They didn't seem to help. (BTW, should I have restarted Passenger somehow after modifying applicaiton_controller.rb?)
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用默认的 Passenger 设置,它会在生产环境中运行您的应用程序 - 这通常意味着类缓存已打开。当您进行配置或代码更改(如您所描述的那样)时,您需要重新启动 Passenger Worker:
此外,您可以通过以下 Passenger 配置将 Passenger 配置切换为在开发环境中运行:
If you're using the default Passenger setup, it runs your application in the production environment - this usually means class caching is turned on. You'll need to restart your Passenger worker when you make config or code changes like the ones you described via:
Additionally, you can switch your Passenger configuration to run in Development environment via the following Passenger config: