Problem with page_attachment extension - following the wiki

OK, this is driving me nuts. I really need the functionality for a few
sites I’m using Radiant for. The only thing I can think of is that the
ImageScience gem is bad or something. I’ve got RMagick, ImageScience
and mini_magick gems installed. Any ideas?

below is a terminal extract:

rake production radiant:extensions:page_attachments:update --trace

(in /home/erbmicha/buildingbridgesmi)
** Invoke production (first_time)
** Execute production
** Invoke environment (first_time)
** Execute environment
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:4:23:
FreeImage.h: No such file or directory
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c: In function
unload': /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:9: error:FIBITMAP’ undeclared (first use in this function)
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:9: error: (Each
undeclared identifier is reported only once
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:9: error: for
each function it appears in.)
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:9: error:
bitmap' undeclared (first use in this function) /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:9: error: syntax error before ')' token /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c: At top level: /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:16: error: syntax error before '*' token /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c: In functionwrap_and_yield’:
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:17: error:
fif' undeclared (first use in this function) /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:17: error:self’ undeclared (first use in this function)
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:19: error:
image' undeclared (first use in this function) /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c: At top level: /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:24: error: syntax error before "FIBITMAP" /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c: In functioncopy_icc_profile’:
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:25: error:
FREE_IMAGE_FORMAT' undeclared (first use in this function) /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:25: error: syntax error before "fif" /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:26: error:fif’ undeclared (first use in this function)
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:26: error:
FIF_PNG' undeclared (first use in this function) /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:27: error:FIICCPROFILE’ undeclared (first use in this function)
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:27: error:
profile' undeclared (first use in this function) /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:27: error:from’ undeclared (first use in this function)
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:29: error: to' undeclared (first use in this function) /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c: At top level: /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:35: error: syntax error before "fif" /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c: In functionFreeImageErrorHandler’:
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:38: error:
fif' undeclared (first use in this function) /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:38: error:FIF_UNKNOWN’ undeclared (first use in this function)
/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c:39: error:
message' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb: In functionwith_image’:
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:138:
error: FREE_IMAGE_FORMAT' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:138: error: syntax error before "fif" /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:140: error:fif’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:141:
error: FIF_UNKNOWN' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:143: error:FIBITMAP’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:143:
error: bitmap' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:145: error:FIF_JPEG’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:145:
error: JPEG_ACCURATE' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb: In functionwith_crop’:
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:160:
error: FIBITMAP' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:160: error:copy’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:162:
error: bitmap' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:162: error: syntax error before ')' token /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb: In functionheight’:
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:170:
error: FIBITMAP' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:170: error:bitmap’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:170:
error: syntax error before ‘)’ token
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:
In function width': /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:178: error:FIBITMAP’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:178:
error: bitmap' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:178: error: syntax error before ')' token /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb: In functionresize’:
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:190:
error: FIBITMAP' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:190: error:bitmap’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:190:
error: syntax error before ‘)’ token
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:191:
error: image' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:191: error:FILTER_CATMULLROM’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:
In function save': /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:201: error:FREE_IMAGE_FORMAT’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:201:
error: syntax error before “fif”
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:202:
error: fif' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:202: error:FIF_UNKNOWN’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:204:
error: FIBITMAP' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:204: error:bitmap’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:204:
error: syntax error before ‘)’ token
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:205:
error: FIF_JPEG' undeclared (first use in this function) /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:205: error:JPEG_QUALITYSUPERB’ undeclared (first use in this function)
/usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:206:
error: FIF_PNG' undeclared (first use in this function) rake aborted! error executing gcc -shared -g -O2 -I /usr/local/lib/ruby/1.8/i686-linux -o "/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.so" "/home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c" -lfreeimage -lstdc++: 256 Renamed /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c to /home/erbmicha/.ruby_inline/Inline_ImageScience_aa58.c.bad /usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.2/./inline.rb:408:inbuild’
/usr/local/lib/ruby/gems/1.8/gems/RubyInline-3.6.2/./inline.rb:628:in
inline' /usr/local/lib/ruby/gems/1.8/gems/image_science-1.1.2/lib/image_science.rb:84 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:ingem_original_require’
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
require' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:inrequire’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:inrequire’
/home/erbmicha/buildingbridgesmi/vendor/extensions/page_attachments/lib/technoweenie/attachment_fu/processors/image_science_processor.rb:1
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:495:in
require' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:495:in
require' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:104:inrequire_or_load’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:248:in
load_missing_constant' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:452:inconst_missing’
/home/erbmicha/buildingbridgesmi/vendor/extensions/page_attachments/lib/technoweenie/attachment_fu.rb:85:in
const_get' /home/erbmicha/buildingbridgesmi/vendor/extensions/page_attachments/lib/technoweenie/attachment_fu.rb:85:inhas_attachment’
/home/erbmicha/buildingbridgesmi/vendor/extensions/page_attachments/app/models/page_attachment.rb:3
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:495:in
require' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:495:in
require' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:104:inrequire_or_load’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:248:in
load_missing_constant' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:452:inconst_missing’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:464:in
const_missing' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:260:inload_missing_constant’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:452:in
const_missing' /home/erbmicha/buildingbridgesmi/vendor/extensions/page_attachments/app/models/observe_page_attachments.rb:3:inincluded’
/home/erbmicha/buildingbridgesmi/vendor/extensions/page_attachments/page_attachments_extension.rb:34:in
include' /home/erbmicha/buildingbridgesmi/vendor/extensions/page_attachments/page_attachments_extension.rb:34:insend’
/home/erbmicha/buildingbridgesmi/vendor/extensions/page_attachments/page_attachments_extension.rb:34:in
activate' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension.rb:38:inactivate’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension_loader.rb:89:in
activate' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension_loader.rb:77:inactivate_extensions’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension_loader.rb:68:in
select' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension_loader.rb:68:inactivate_extensions’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/extension_loader.rb:42:in
run' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/initializer.rb:43:ininitialize_extensions’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/initializer.rb:36:in
after_initialize' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/railties/lib/initializer.rb:114:inprocess’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/railties/lib/initializer.rb:43:in
send' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/railties/lib/initializer.rb:43:inrun’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/radiant/initializer.rb:32:in
run' /home/erbmicha/buildingbridgesmi/config/../config/environment.rb:15 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/vendor/rails/railties/lib/tasks/misc.rake:3 /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:incall’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in
execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:ineach’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in
execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:ininvoke’
/usr/local/lib/ruby/1.8/thread.rb:135:in synchronize' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:ininvoke’
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.2/lib/tasks/environments.rake:10
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in call' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:inexecute’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:inexecute’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:in invoke' /usr/local/lib/ruby/1.8/thread.rb:135:insynchronize’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:inrun’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:inrun’
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.2/bin/rake:7
/usr/local/bin/rake:16:in `load’
/usr/local/bin/rake:16

Mike,

If you want to use ImageScience, you need the FreeImage library
installed. Notice that it says ‘FreeImage.h: No such file or
directory’. You can download FreeImage here:

http://freeimage.sourceforge.net

Sean

p.s. attachment_fu, the Rails plugin that is included in
page_attachments, prefers ImageScience over MiniMagick and RMagick. If
you want it to fall back on one of those, you have to either uninstall
the ImageScience or specify the processor in page_attachment.rb.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs