Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails NoMethodError(未定义的方法`gsub';用于#<;散列:0x0000102EC5AB0>;):_Ruby On Rails_Ruby On Rails 3 - Fatal编程技术网

Ruby on rails NoMethodError(未定义的方法`gsub';用于#<;散列:0x0000102EC5AB0>;):

Ruby on rails NoMethodError(未定义的方法`gsub';用于#<;散列:0x0000102EC5AB0>;):,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,在我的任何控制器中,使用Desive,我有: before_filter :authenticate_user! 如果我未登录,则从Desive重定向到登录不起作用。相反,我得到了以下错误: Started GET "/settings/account" for 127.0.0.1 at 2011-12-21 18:43:20 -0800 Processing by SettingsController#account as HTML Completed 401 Unauthorized

在我的任何控制器中,使用Desive,我有:

before_filter :authenticate_user!
如果我未登录,则从Desive重定向到登录不起作用。相反,我得到了以下错误:

Started GET "/settings/account" for 127.0.0.1 at 2011-12-21 18:43:20 -0800
  Processing by SettingsController#account as HTML
Completed 401 Unauthorized in 3ms

NoMethodError (undefined method `gsub' for #<Hash:0x000001070a0a20>):


Rendered /Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms)
Rendered /Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.2ms)
Rendered /Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (6.5ms)
2011年12月21日18:43:20-0800,127.0.0.1版的
开始获取“/设置/帐户”
通过将控制器#帐户设置为HTML进行处理
在3毫秒内完成
NoMethodError(用于#的未定义方法“gsub”):
Rendered/Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/gems/actionpack-3.0.9/lib/action\u dispatch/middleware/templates/rescues//u trace.erb(1.0ms)
Rendered/Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/gems/actionpack-3.0.9/lib/action\u dispatch/middleware/templates/rescues//u request\u and_response.erb(2.2ms)
Rendered/Users/xxx/.rvm/gems/ruby-1.9.2-p180@andyw/rescues/布局中的gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb(6.5ms)

关于如何调试这个有什么想法吗?谢谢

有什么想法吗?非常感谢你为我们提供了一些代码。帐户是什么样子的?你看到任何一个尝试做gsub的地方了吗?