ImageScience and inline ruby
September 22nd 2008Just thought i'd mention a link that saved me a couple of hours this morning: if your mongrel does this on ImageScience invocations:
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.7/lib/inline.rb:73:in `exit'
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.7/lib/inline.rb:73:in `rootdir'
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.7/lib/inline.rb:87:in `directory'
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.7/lib/inline.rb:257:in `so_name'
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.7/lib/inline.rb:297:in `load_cache'
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.7/lib/inline.rb:708:in `inline'
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.3/lib/image_science.rb:84
...
It means it doesn't find an environment variable INLINEDIR (or HOME, actually). It's used in the context of inline invocation of the FreeImage library (freeimage-VERSION.so). The function of this INLINEDIR directory is unclear to me, so i'll need to look into the whole RubyInline thing.
How to fix this: in config/environments/production.rb:
#Ruby Inline Permissions Hackery
ENV['INLINEDIR'] = RAILS_ROOT + “/tmp/.ruby_inline”
Thank you, thank you Mandarin Soda !