Hello all - I installed ruby-shapelib - it looks great!
However, I have been having trouble getting it to run on ruby1.9 (as opposed to 1.8). Here is the error message:
irb(main):001:0> require 'shapelib'
LoadError: dlopen(/opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10/shapelib.bundle, 9): Symbol not found: _ruby_safe_level
Referenced from: /opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10/shapelib.bundle
Expected in: flat namespace
in /opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10/shapelib.bundle - /opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10/shapelib.bundle
from (irb):1:in `require'
from (irb):1
from /opt/local/bin/irb1.9:12:in `<main>'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Right now I don't have ruby 1.9 environment, so could you help me to try following?
This blog says variable ruby_safe_level is renamed as function rb_safe_level(). So I guess it should work if you change "ruby_safe_level" at line 307 of valconv.h to "rb_safe_level()" and then recompile?
I would appreciate much if you could report.
Best,
prasinos
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-08-03
The suggested edit does work. However, I also had to edit both spcode.h and sfcode.h and update macro calls to use the new Ruby macros e.g.:
RSTRING(name)->ptr
becomes
RSTRING_PTR(name)
RARRAY(name)->ptr
becomes
RARRAY_PTR(name)[6[
etc. Updating all the macros resulted in successful compilation. Tests 1 & 2, however, during make test fails with an error that seems to indicate a unicode conversion error:
test1 failed: invalid value for Integer: "\xA1" (ArgumentError)
test2 failed: invalid value for Integer: "\xE8" (ArgumentError)
Haven't troubleshot this yet but this should at least get you started.
-j
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2010-08-06
Thank you for this help. If you manage to get the full 1.9 version working, do let us know (right now I am dropping back to 1.8 as needed.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all - I installed ruby-shapelib - it looks great!
However, I have been having trouble getting it to run on ruby1.9 (as opposed to 1.8). Here is the error message:
irb(main):001:0> require 'shapelib'
LoadError: dlopen(/opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10/shapelib.bundle, 9): Symbol not found: _ruby_safe_level
Referenced from: /opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10/shapelib.bundle
Expected in: flat namespace
in /opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10/shapelib.bundle - /opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10/shapelib.bundle
from (irb):1:in `require'
from (irb):1
from /opt/local/bin/irb1.9:12:in `<main>'
Right now I don't have ruby 1.9 environment, so could you help me to try following?
This blog says variable ruby_safe_level is renamed as function rb_safe_level(). So I guess it should work if you change "ruby_safe_level" at line 307 of valconv.h to "rb_safe_level()" and then recompile?
I would appreciate much if you could report.
Best,
prasinos
The suggested edit does work. However, I also had to edit both spcode.h and sfcode.h and update macro calls to use the new Ruby macros e.g.:
RSTRING(name)->ptr
becomes
RSTRING_PTR(name)
RARRAY(name)->ptr
becomes
RARRAY_PTR(name)[6[
etc. Updating all the macros resulted in successful compilation. Tests 1 & 2, however, during make test fails with an error that seems to indicate a unicode conversion error:
test1 failed: invalid value for Integer: "\xA1" (ArgumentError)
test2 failed: invalid value for Integer: "\xE8" (ArgumentError)
Haven't troubleshot this yet but this should at least get you started.
-j
Thank you for this help. If you manage to get the full 1.9 version working, do let us know (right now I am dropping back to 1.8 as needed.)