0

I am using GDAL in my rails 3 project. I cannot seem to figure out how to get it to work properly without defaulting to the system ruby. Rails complains that it can't find "gdal/org" even though its installed. How can I make this link in RVM and still use my ruby gemset?

whyvez
  • 303
  • 3
  • 12

2 Answers2

2

Sounds like you installed the libraries but how are you trying to have Ruby utilize them? Per my understanding, installing libgdal-ruby via apt would install everything in the system paths which wouldn't be automatically loaded by default by a Ruby installed via RVM nor your Rails application using Bundler, which isolates gems. Perhaps you can try setting something like

ENV['LD_LIBRARY_PATH'] = "#{ENV['LD_LIBRARY_PATH']}:/path/to/gdal/libs"

in your environment.rb to include the libraries for gdal. You might also need a custom initializer to require it on application boot.

Remear
  • 1,927
  • 12
  • 19
0

Better yet I found this gem which works perfectly: github.com/zhm/gdal-ruby.

whyvez
  • 303
  • 3
  • 12