0

Hopefully somebody can be of help to me here.

I´m using linux, ruby version 1.8.7 and rails version 3.2.21 and redmine version 2.6.2

I´m dealing with an error when trying to install/run chartkick

before installing i´ve shut down redmine server and

I followed these steps to install:

in Gemfile put the line

gem 'chartkick'

an executed the follwing comand to install this gem:

bundle install --without production

at first time, it seems that installed with sucess cause no error is informed.

but when i run up the redmine server it shows me the error..

see stacktrace below:

# /usr/lib/ruby/gems/1.8/gems/bundler-1.10.1/lib/bundler/runtime.rb:76:in 'require': /usr/lib/ruby/gems/1.8/gems/chartkick-1.4.2/lib/chartkick.rb:20: odd number list for Hash (Syntax Error)
    {name: name, data: data.map { |k, v| [k[1], v] }}
              ^  
/usr/lib/ruby/gems/1.8/gems/chartkick-1.4.2/lib/chartkick.rb:20: syntax error, unexpected ':', expecting '}'
    {name: name, data: data.map { |k, v| [k[1], v] }}
              ^  
/usr/lib/ruby/gems/1.8/gems/chartkick-1.4.2/lib/chartkick.rb:20: syntax error, unexpected ':', expecting '='
    {name: name, data: data.map { |k, v| [k[1], v] }}
                          ^  
/usr/lib/ruby/gems/1.8/gems/chartkick-1.4.2/lib/chartkick.rb:20: syntax error, unexpected '}', expecting kEND
/usr/lib/ruby/gems/1.8/gems/chartkick-1.4.2/lib/chartkick.rb:26: syntax error, unexpected $end, expecting kEND

Please, Any ideas what whould i do to solve this problem ? what am i doing wrong ? Thanks !

1 Answers1

0

It's pretty clear error:

You'v bundled gem written with ruby 1.9 hash syntax.

In version 1.9 Ruby introduced new syntax for hash literals whose keys are symbols. Hashes use the "hash rocket" operator to separate the key and the value

According to provided setup you can safely upgrade your ruby from 1.8 to at least 1.9.3[-p551]

Check RBenv or RVM to install certain version of Ruby.

Noma4i
  • 751
  • 7
  • 19