ActionView::Template::Error(无法就地修改 SafeBuffer)haml devise

发布于 2024-11-30 16:45:39 字数 2097 浏览 1 评论 0原文

在我使用捆绑器更改了安装的所有 gem 中的 Gemfile 后,我注意到一个错误:

TypeError in Devise/sessions#new
Showing /home/mark/workspace/fleet/app/views/layouts/application.html.haml where line # raised:
Cannot modify SafeBuffer in place

服务器日志说:

16:22:12 Started GET "/users/sign_in" for 127.0.0.1 at 2011-08-22 16:22:12 +0200
16:22:12 action_controller Processing by Devise::SessionsController#new as HTML
16:22:12 active_record SQL (2.4ms)   SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
 FROM pg_attribute a LEFT JOIN pg_attrdef d
 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
 WHERE a.attrelid = '"users"'::regclass
 AND a.attnum > 0 AND NOT a.attisdropped
 ORDER BY a.attnum
16:22:12 action_view Rendered devise/sessions/new.html.haml within layouts/application (47.8ms)
16:22:12 action_controller Completed 500 Internal Server Error in 101ms

16:22:12 ActionView::Template::Error (Cannot modify SafeBuffer in place):
16:22:12 action_view Rendered /home/mark/.rvm/gems/ruby-1.9.2-head@fleet/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms)
16:22:12 action_view Rendered /home/mark/.rvm/gems/ruby-1.9.2-head@fleet/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (299.0ms)
16:22:12 action_view Rendered /home/mark/.rvm/gems/ruby-1.9.2-head@fleet/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (306.6ms)

我的 app/views/devise/sessions/new.html.haml 看起来像:

%h2 sign_in

我的 gem 文件看起来像: 来源 'http://rubygems.org'

gem 'rails', '3.0.9'
gem 'pg'
gem 'jquery-rails'
gem 'devise', :git => "git://github.com/plataformatec/devise.git"
gem 'capistrano'

gem 'rmagick'
gem 'carrierwave'
gem 'paper_trail'
gem 'kaminari'

gem 'haml'
gem 'cancan'

# FOR XLS MANIPULATION
gem 'rubyzip'
gem 'nokogiri'
gem 'roo'
gem 'to_xls'

我完全不知道发生了什么。我尝试谷歌搜索,但什么也没找到:-(如果有人有类似的问题或知道这个特定错误的解决方案,我将不胜感激分享:)

提前谢谢你! 干杯

After i changed my Gemfile in installed all the gems using bundler i noticed a error:

TypeError in Devise/sessions#new
Showing /home/mark/workspace/fleet/app/views/layouts/application.html.haml where line # raised:
Cannot modify SafeBuffer in place

The server log sais:

16:22:12 Started GET "/users/sign_in" for 127.0.0.1 at 2011-08-22 16:22:12 +0200
16:22:12 action_controller Processing by Devise::SessionsController#new as HTML
16:22:12 active_record SQL (2.4ms)   SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
 FROM pg_attribute a LEFT JOIN pg_attrdef d
 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
 WHERE a.attrelid = '"users"'::regclass
 AND a.attnum > 0 AND NOT a.attisdropped
 ORDER BY a.attnum
16:22:12 action_view Rendered devise/sessions/new.html.haml within layouts/application (47.8ms)
16:22:12 action_controller Completed 500 Internal Server Error in 101ms

16:22:12 ActionView::Template::Error (Cannot modify SafeBuffer in place):
16:22:12 action_view Rendered /home/mark/.rvm/gems/ruby-1.9.2-head@fleet/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms)
16:22:12 action_view Rendered /home/mark/.rvm/gems/ruby-1.9.2-head@fleet/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (299.0ms)
16:22:12 action_view Rendered /home/mark/.rvm/gems/ruby-1.9.2-head@fleet/gems/actionpack-3.0.9/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (306.6ms)

My app/views/devise/sessions/new.html.haml looks like:

%h2 sign_in

My gem file looks like:
source 'http://rubygems.org'

gem 'rails', '3.0.9'
gem 'pg'
gem 'jquery-rails'
gem 'devise', :git => "git://github.com/plataformatec/devise.git"
gem 'capistrano'

gem 'rmagick'
gem 'carrierwave'
gem 'paper_trail'
gem 'kaminari'

gem 'haml'
gem 'cancan'

# FOR XLS MANIPULATION
gem 'rubyzip'
gem 'nokogiri'
gem 'roo'
gem 'to_xls'

I have absolutely no idea what happened. I tried to google and found nothing :-( If anyone had a similar problem or knows the solution for this particular error I would grateful for sharing :)

Thank you in advance!
Cheers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

醉殇 2024-12-07 16:45:39

哈姆尔中的错误。 3.1.2版本已修复

Bug in haml. Fixed in version 3.1.2

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