# Attachment\_fu and ImageScience - problem with RubyInline gem

**URL:** <https://www.ruby-forum.com/t/attachment-fu-and-imagescience-problem-with-rubyinline-gem/125091>\
**Category:** Rails\
**Created:** [January 5, 2008, 8:09am UTC](https://www.ruby-forum.com/t/attachment-fu-and-imagescience-problem-with-rubyinline-gem/125091 "2008-01-05T08:09:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 5, 2008, 8:09am UTC](https://www.ruby-forum.com/t/attachment-fu-and-imagescience-problem-with-rubyinline-gem/125091/1 "2008-01-05T08:09:53Z")

</div>

Hi,

I am experiencing the following error when I configure attachment\_fu  
to use ImageScience.

I have downloaded and compiled FreeImage, and installed the  
ImageScience (1.1.3) gem (which installs the RubyInline gem 3.6.6).

Any advice or pointers to other help would be very much appreciated. I  
have spent several hours trying to fix this with no success.

Thanks!

Error output:

SystemExit (ERROR: Can’t find header dir for ruby. Exiting…):  
/usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.5/lib/inline.rb:385:in  
`abort' /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.5/lib/inline.rb:385:in`build’  
/usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.5/lib/inline.rb:679:in  
`inline' /usr/lib/ruby/gems/1.8/gems/image_science-1.1.3/lib/ image_science.rb:84 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in`gem\_original\_require’  
/usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:32:in  
`require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/ dependencies.rb:495:in`require’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active\_support/  
dependencies.rb:342:in `new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/ dependencies.rb:495:in`require’  
/home/leelon/workspace/Pingee/vendor/plugins/attachment\_fu/lib/  
technoweenie/attachment\_fu/processors/image\_science\_processor.rb:1  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active\_support/  
dependencies.rb:203:in `load_without_new_constant_marking' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/ dependencies.rb:203:in`load\_file’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active\_support/  
dependencies.rb:342:in `new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/ dependencies.rb:202:in`load\_file’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active\_support/  
dependencies.rb:94:in `require_or_load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/ dependencies.rb:248:in`load\_missing\_constant’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active\_support/  
dependencies.rb:452:in `const_missing' /home/leelon/workspace/Pingee/vendor/plugins/attachment_fu/lib/ technoweenie/attachment_fu.rb:87:in`const\_get’  
/home/leelon/workspace/Pingee/vendor/plugins/attachment\_fu/lib/  
technoweenie/attachment\_fu.rb:87:in `has\_attachment’  
/home/leelon/workspace/Pingee/app/models/picture\_attachment.rb:6  
…

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 5, 2008, 11:05am UTC](https://www.ruby-forum.com/t/attachment-fu-and-imagescience-problem-with-rubyinline-gem/125091/2 "2008-01-05T11:05:57Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Hi,
> 
> I am experiencing the following error when I configure attachment\_fu  
> to use ImageScience.
> 
> I have downloaded and compiled FreeImage, and installed the  
> ImageScience (1.1.3) gem (which installs the RubyInline gem 3.6.6).
> 
> Any advice or pointers to other help would be very much appreciated. I  
> have spent several hours trying to fix this with no success.
> 
> Thanks!

I followed the same steps and am getting the exact same error. Its very  
frustrating.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 7, 2008, 12:22pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-imagescience-problem-with-rubyinline-gem/125091/3 "2008-01-07T12:22:28Z")

</div>

Gary and others,

I finally found the solution – thanks to the great book “Ruby  
Cookbook” – and Image Science is now working perfectly 🙂

I was missing a Ruby library “ruby1.8-dev” (header files for compiling  
extension modules for the Ruby 1.8). It can be easily installed  
through your distro’s package manager tool or using:

sudo apt-get install ruby1.8-dev

Note I am running “ruby 1.8.6 (2007-06-07 patchlevel 36) [x86\_64-  
linux]”

RubyInline requires this package.

I hope this solves your problem too.
