boazsegev / combine_pdf

A Pure ruby library to merge PDF files, number pages and maybe more...
MIT License
734 stars 155 forks source link

require "combine_pdf" - SyntaxError: /usr/local/rvm/gems/ruby-1.8.7-p374/gems/combine_pdf-1.0.16/lib/combine_pdf/api.rb:11: syntax error, unexpected ':', expecting ')' #161

Closed estelleccl closed 5 years ago

estelleccl commented 5 years ago

Hi,

I hit the following error when require "combine_pdf" in the console. What should I do?

Error:- SyntaxError: /usr/local/rvm/gems/ruby-1.8.7-p374/gems/combine_pdf-1.0.16/lib/combine_pdf/api.rb:11: syntax error, unexpected ':', expecting ')' ...r.new(IO.read(file_name, mode: 'rb').force_encoding(Encoding... ^ /usr/local/rvm/gems/ruby-1.8.7-p374/gems/combine_pdf-1.0.16/lib/combine_pdf/api.rb:11: syntax error, unexpected ')', expecting kEND ...IO.read(file_name, mode: 'rb').force_encoding(Encoding::ASCI... ^ /usr/local/rvm/gems/ruby-1.8.7-p374/gems/combine_pdf-1.0.16/lib/combine_pdf/api.rb:11: syntax error, unexpected ',', expecting kEND ...ncoding(Encoding::ASCII_8BIT), options)) ^ /usr/local/rvm/gems/ruby-1.8.7-p374/gems/combine_pdf-1.0.16/lib/combine_pdf/api.rb:121: odd number list for Hash p = { deg: 0, tx: 0, ty: 0, sx: 1, sy: 1 }.merge parameters ^ /usr/local/rvm/gems/ruby-1.8.7-p374/gems/combine_pdf-1.0.16/lib/combine_pdf/api.rb:121: syntax error, unexpected ':', expecting '}' p = { deg: 0, tx: 0, ty: 0, sx: 1, sy: 1 }.merge parameters ^ /usr/local/rvm/gems/ruby-1.8.7-p374/gems/combine_pdf-1.0.16/lib/combine_pdf/api.rb:180: syntax error, unexpected $end, expecting kEND

boazsegev commented 5 years ago

Hi @estelleccl,

Thank you for opening the this issue.

The error is probably caused by the fact that you’re using Ruby 1.8.7 (according to the log). Version 1.8.7 is a very old version and it isn’t supported any more (not even by the official Ruby language).

In fact, on March 31st, 2019, support for Ruby version 2.3.x has ended. This means you should update to version 2.4.x or higher.

I recommend that you update your Ruby version to the latest stable release.

Let me know if this solves your issue.

Kindly, Bo.

boazsegev commented 5 years ago

I'm closing this issue. Feel free to open a new issue if you have more questions or encounter any issues.

Kindly, Bo.