5
votes

I have an application I am upgrading to 3.1 from Rails 3.0.9. But, I am getting a syntax error or something. It reads:

SyntaxError in BooksController#index

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

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

Application Trace | Framework Trace | Full Trace

app/models/user.rb:11:in `admin?'

app/models/ability.rb:8:in `initialize'

Any ideas?

Note: All controllers worked fine in 3.0.9

2
This is not from CanCan it is from MySQL2 not being compatible. It is version 0.2.6 and rails 3 needs a newer one...problem is they are not compiling for Windows. - Travis Pessetto
Might be useful to know: cancan2 (still on beta) is working on rails 3.1 (get it from github) - vincent jacquel
@vincent jacquel...I the gem works fine. I found out later for some reason it was the MySQL2 Gem (0.2.6 not compatible with 3.1) thanks though. - Travis Pessetto

2 Answers

4
votes

Just upgrade to latest version of mysql2 gem. In my case it is 0.3.7 now.

2
votes

It has nothing to do with CanCan. It is most likely MySQL2 if using Windows...have fun trying to update.