leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
545 stars 214 forks source link

syntax error, unexpected tLABEL #289

Open KarenArzumanyan opened 8 years ago

KarenArzumanyan commented 8 years ago

After update plugin redmine_login_audit to latest version from git.

Information about my system:

Environment: Redmine version 3.0.1.stable Ruby version 1.9.3-p484 (2013-11-22) [x86_64-linux] Rails version 4.2.0 Environment production Database adapter Mysql2

akr@svn-server:/usr/share/redmine/plugins$ uname -a
Linux svn-server 3.13.0-85-generic #129-Ubuntu SMP Thu Mar 17 20:50:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

akr@svn-server:/usr/share/redmine/plugins$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.4 LTS
Release:        14.04
Codename:       trusty

akr@svn-server:/usr/share/redmine/plugins$ ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

When try migrate for plugin, get this error:

akr@svn-server:/usr/share/redmine/plugins$ sudo rake redmine:plugins:migrate RAILS_ENV=production
(in /usr/share/redmine)
rake aborted!
SyntaxError: /var/lib/gems/1.9.1/gems/wice_grid-3.5.0/lib/wice/wice_grid_misc.rb:97: syntax error, unexpected tLABEL
      def value_for(key, strict: true) #:nodoc:
                                ^
/var/lib/gems/1.9.1/gems/wice_grid-3.5.0/lib/wice/wice_grid_misc.rb:131: syntax error, unexpected keyword_end, expecting $end
/var/lib/gems/1.9.1/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/var/lib/gems/1.9.1/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
/var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/lib/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/1.9.1/gems/wice_grid-3.5.0/lib/wice_grid.rb:1:in `<top (required)>'
/var/lib/gems/1.9.1/gems/bundler-1.7.4/lib/bundler/runtime.rb:76:in `require'
/var/lib/gems/1.9.1/gems/bundler-1.7.4/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/var/lib/gems/1.9.1/gems/bundler-1.7.4/lib/bundler/runtime.rb:72:in `each'
/var/lib/gems/1.9.1/gems/bundler-1.7.4/lib/bundler/runtime.rb:72:in `block in require'
/var/lib/gems/1.9.1/gems/bundler-1.7.4/lib/bundler/runtime.rb:61:in `each'
/var/lib/gems/1.9.1/gems/bundler-1.7.4/lib/bundler/runtime.rb:61:in `require'
/var/lib/gems/1.9.1/gems/bundler-1.7.4/lib/bundler.rb:133:in `require'
/usr/share/redmine/config/application.rb:5:in `<top (required)>'
/usr/share/redmine/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)

I changed "(key, strict: true)" code to this "(key, strict = true)".

akr@svn-server:/usr/share/redmine/plugins$ sudo mcedit /var/lib/gems/1.9.1/gems/wice_grid-3.5.0/lib/wice/wice_grid_misc.rb

I'm not an expert in Ruby. Maybe this is wrong. But migration is performed without error.

akr@svn-server:/usr/share/redmine/plugins$ sudo rake redmine:plugins:migrate RAILS_ENV=production
(in /usr/share/redmine)
Migrating redmine_base_deface (Redmine Base Deface plugin)...
Migrating redmine_lightbox2 (Redmine Lightbox 2)...
Migrating redmine_login_audit (Redmine Login Audit plugin)...
Migrating redmine_maintenance_mode (Redmine Maintenance Mode)...
leikind commented 8 years ago

Ruby 1.9.1 is very very very ancient, you should upgrade to at least 2.0.