smhk

Running inkscape_merge against Inkscape v1.0

Just upgraded Inkscape from v0.92 to v1.0. This caused my inkscape_merge tool to break, with the error:

$ inkscape_merge
bash: /usr/local/bin/inkscape_merge: /usr/bin/ruby2.5: bad interpreter: No such file or directory

Looks like my version of ruby has upgraded, so the tool no longer works:

$ ruby --version
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux-gnu]

I tried re-installing inkscape_merge:

$ sudo gem install inkscape_merge

However, now I get a different error:

$ ./build.sh 
/var/lib/gems/2.7.0/gems/inkscape_merge-0.3.0/lib/inkscape_merge/data_parsers.rb:34: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/lib/ruby/2.7.0/csv.rb:714: warning: The called method `read' is defined here
Row: 1
Inkscape ERROR (pid 8200 exit 1): Unknown option --without-gui
[...]

The Inkscape --without-gui option has been removed in Inkscape v1.0.

Manually modified /var/lib/gems/2.7.0/gems/inkscape_merge-0.3.0/lib/inkscape_merge/processor.rb line 124 to remove the --without-gui option.

$ ./build.sh 
/var/lib/gems/2.7.0/gems/inkscape_merge-0.3.0/lib/inkscape_merge/data_parsers.rb:34: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/lib/ruby/2.7.0/csv.rb:714: warning: The called method `read' is defined here
Row: 1
Inkscape ERROR (pid 8644 exit 1): Unknown option --export-png=/home/sam/Documents/hbd-2020/cards/batch/card_1.png

Manually modified /var/lib/gems/2.7.0/gems/inkscape_merge-0.3.0/lib/inkscape_merge/processor.rb again.

Changed --export-png=... to --export-type=png and --export-filename=...

Changed line 124 to:

cmd = %(#{Shellwords.escape(@options.inkscape)} --export-dpi=#{dpi} --export-type=#{format} --export-filename=#{new_out_file} #{new_in_file})

And try again:

$ ./build.sh 
/var/lib/gems/2.7.0/gems/inkscape_merge-0.3.0/lib/inkscape_merge/data_parsers.rb:34: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/lib/ruby/2.7.0/csv.rb:714: warning: The called method `read' is defined here
Row: 1
Row: 2
Row: 3
Row: 4
Row: 5
Row: 6
Row: 7
Row: 8
Row: 9
Row: 10
Row: 11
Row: 12
Row: 13
Row: 14
Row: 15
Row: 16

Hooray, it works.