syntax error, unexpected kEND in active_record/attribute_methods/read.rb
I'm setting up a working application on a new environment, and after running 'bundle install' I try to launch an application. And I get a following error:
ActionView::Template::Error (compile error
D:/Dev_apps/Ruby187/lib/ruby/gems/1.8/gems/activereco开发者_Python百科rd-3.1.0.rc5/lib/active_record/attribute_methods/read.rb:85: syntax error, unexpected kEND
D:/Dev_apps/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.1.0.rc5/lib/active_record/attribute_methods/read.rb:87: syntax error, unexpected $end, expecting kEND):
6: <nav class="round">
7:
8: <ul>
9: <% if can? :browse_backend, current_user %>
10: <li><%= link_to "Админка", admin_root_path %></li>
11: <% end %>
12:
app/models/user.rb:60:in `has_role?'
app/models/ability.rb:14:in `initialize'
app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___239100443_122539296'
app/views/layouts/application.html.erb:16:in `_app_views_layouts_application_html_erb__144136837_122749020'
What I can't understand is how can that happen in a gem.
I got this error when I upgraded my app to rails 3.1 and I was able to fix it by installing a more recent version of the mysql2 gem (I installed 0.3.7).
The problem is in your code but since the gems use your code to do their magic it seems like the error comes from the gem.
Check your user.rb file at line 60. You might have a syntax error around there.
精彩评论