简体   繁体   English

从CanCan从Rails 3.0.9升级到Rails 3.1错误

[英]Upgrading from Rails 3.0.9 to Rails 3.1 errors from CanCan

I have an application I am upgrading to 3.1 from Rails 3.0.9. 我有一个要从Rails 3.0.9升级到3.1的应用程序。 But, I am getting a syntax error or something. 但是,我收到语法错误之类的东西。 It reads: 内容为:

SyntaxError in BooksController#index BooksController#index中的SyntaxError

c:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/active_record/attribute_methods/read.rb:91: syntax error, unexpected keyword_end c:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/active_record/attribute_methods/read.rb:93: syntax error, unexpected $end, expecting keyword_end c:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.0/lib/active_record/attribute_methods/read.rb:91:语法错误,意外的keyword_end c:/ Ruby192 / lib / ruby​​ / gems /1.9.1/gems/activerecord-3.1.0/lib/active_record/attribute_methods/read.rb:93:语法错误,意外的$ end,期望的keyword_end

Rails.root: c:/Users/Travis/My Documents/Aptana Studio 3 Workspace/clicknslide Rails.root:c:/ Users / Travis / My Documents / Aptana Studio 3工作区/ clicknslide

Application Trace | 应用程序跟踪| Framework Trace | 框架跟踪 Full Trace 全迹

app/models/user.rb:11:in `admin?' app / models / user.rb:11:在“管理员?”中

app/models/ability.rb:8:in `initialize' app / models / ability.rb:8:在“初始化”中

Any ideas? 有任何想法吗?

Note: All controllers worked fine in 3.0.9 注意:所有控制器在3.0.9中均能正常工作

Just upgrade to latest version of mysql2 gem. 只需升级到最新版本的mysql2 gem。 In my case it is 0.3.7 now. 就我而言,现在是0.3.7。

It has nothing to do with CanCan. 它与CanCan无关。 It is most likely MySQL2 if using Windows...have fun trying to update. 如果使用Windows,很可能是MySQL2 ...尝试更新很有趣。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM