Author Topic: help with running the ruby script to convert svg in to XMls.  (Read 659 times)

sunhear

  • Hydlaa Resident
  • *
  • Posts: 58
    • View Profile
hi

i am trying to run the ruby script to convert svg in to XMls.


require 'planeshift_sketch_xml'
Dir.foreach('~/.PlaneShift/sketches') do |name|
  sketch = PlaneShiftSketchXML.load_from(name)
  sketch.add_text(sketch.width - 300, sketch.height - 50, 'signature')
  sketch.save_to(name)
end

when i run it it  gives me

irb(main):001:0> require 'planeshift_sketch_xml'
LoadError: cannot load such file -- planeshift_sketch_xml
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custo
m_require.rb:36:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custo
m_require.rb:36:in `require'
        from (irb):1
        from C:/RailsInstaller/Ruby1.9.3/bin/irb:12:in `<main>'
<h('C:\Users\sunhear\AppData\Roaming\PlaneShift\sketches\oja_1.xml') do |name|
< PlaneShiftSketchXML.load_from(F:\Personial\planeshift\map\oja_rode_1.)
<dd_text(sketch.width - 300, sketch.height - 50, 'signature')
<ave_to(C:\users\sunhear\AppData\Roaming\PlaneShift\sketches\oja_1)
irb(main):006:1> end
SyntaxError: (irb):3: syntax error, unexpected $undefined
...aneShiftSketchXML.load_from(F:\Personial\planeshift\map\oja_...
...                               ^
(irb):5: syntax error, unexpected $undefined
  sketch.save_to(C:\users\sunhear\AppData\Roaming\P...
                    ^
        from C:/RailsInstaller/Ruby1.9.3/bin/irb:12:in `<main>'
irb(main):007:0>

frist i am right in gessing where to subatute the paths of the file? can any help me run the script?

sunhear



Calmus

  • Traveller
  • *
  • Posts: 29
    • View Profile
Re: help with running the ruby script to convert svg in to XMls.
« Reply #1 on: June 14, 2014, 05:24:05 pm »
in the path where you run this script, is there a file "planeshift_sketch_xml.rb" or is this supposed to be installed as a gem?

to run a ruby script, you can write something like that...
Code: [Select]
ruby path_to/my_script.rbthe path to the script may be a relative path or even just a filename, if the file is at the current path of your terminal.

under Windows it might complain that it doesn't find the command 'ruby', then you will have to enter the full path to the ruby executable. With ruby I have only experience on Linux systems.

sunhear

  • Hydlaa Resident
  • *
  • Posts: 58
    • View Profile
Re: help with running the ruby script to convert svg in to XMls.
« Reply #2 on: June 17, 2014, 07:39:43 pm »
can you enplane more?