# Libjpeg error in gd2

**URL:** <https://www.ruby-forum.com/t/libjpeg-error-in-gd2/149821>\
**Category:** Rails\
**Created:** [September 30, 2008, 9:20am UTC](https://www.ruby-forum.com/t/libjpeg-error-in-gd2/149821 "2008-09-30T09:20:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pwever](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/87869e/32.png) [@pwever](https://www.ruby-forum.com/u/pwever)\
**Post date:** [September 30, 2008, 9:20am UTC](https://www.ruby-forum.com/t/libjpeg-error-in-gd2/149821/1 "2008-09-30T09:20:43Z")

</div>

Hi there,

I am trying to install gd2 under OS X 10.5 in order to get this  
thumbnail generator ([Error](http://www.cleverleap.com/ruby-thumbnail-)  
generator/) to work. After appreciating the number of dependencies, I  
opted for installing it via MacPorts. Unfortunately I still run into  
error messages.

First I needed to link the /usr/lib/libgd.2.dylib to /opt/local/lib/  
libgd.2.dylib  
sudo ln -s /opt/local/lib/libgd.2.dylib /usr/lib/libgd.2.dylib

But even after that, I continue to get an error. This time it seems to  
be a problem with the jpeg library. I tried linking the libjpeg.dylib  
as well, but that didn’t fix the problem.

Does anybody have any other ideas?  
Many thanks in advance.  
Pascal

/\*\*\*\* ERROR MESSAGE \*\*\*\*\*\*\*\*/  
RuntimeError in ThumbController#index

unknown symbol “gdImageJpeg”

RAILS\_ROOT: /Users/pwever/Pascal/Projects/TeamSite/DandS  
Application Trace | Framework Trace | Full Trace

/Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150:in `[]' /Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150 /Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150:in `each’  
/Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150:in `inject' /Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150 app/controllers/thumb_controller.rb:8 /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in `process’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in  
`synchronize' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `process’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in  
`process_client' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in  
`process_client' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in  
`initialize' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:  
282:in `run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb: 281:in `each’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:  
281:in `run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:  
212:in `run’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel\_rails:281

vendor/rails/activesupport/lib/active\_support/inflector.rb:257:in  
`inject' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem\_original\_require’  
/Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in `require' vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:203:in  
`load_without_new_constant_marking' vendor/rails/activesupport/lib/active_support/dependencies.rb:203:in `load\_file’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:202:in `load\_file’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:94:in  
`require_or_load' vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in `load\_missing\_constant’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:453:in  
`const_missing' vendor/rails/activesupport/lib/active_support/dependencies.rb:465:in `const\_missing’  
vendor/rails/activesupport/lib/active\_support/inflector.rb:257:in  
`constantize' vendor/rails/activesupport/lib/active_support/core_ext/string/ inflections.rb:148:in `constantize’  
vendor/rails/actionpack/lib/action\_controller/routing.rb:1426:in  
`recognize' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:170:in `handle\_request’  
vendor/rails/actionpack/lib/action\_controller/dispatcher.rb:115:in  
`dispatch' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in `dispatch\_cgi’  
vendor/rails/actionpack/lib/action\_controller/dispatcher.rb:9:in  
`dispatch' vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in `load’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:489:in  
`load' vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new\_constants\_in’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:489:in  
`load' vendor/rails/railties/lib/commands/servers/mongrel.rb:64 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem\_original\_require’  
/Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in `require' vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require’  
vendor/rails/railties/lib/commands/server.rb:39  
script/server:3:in `require’  
script/server:3

/Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150:in `[]' /Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150 vendor/rails/activesupport/lib/active_support/inflector.rb:257:in `inject’  
/Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150:in `each' /Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150:in `inject’  
/Library/Ruby/Gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150  
/Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:496:in  
`require' vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new\_constants\_in’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:496:in  
`require' app/controllers/thumb_controller.rb:8 vendor/rails/activesupport/lib/active_support/dependencies.rb:203:in `load\_without\_new\_constant\_marking’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:203:in  
`load_file' vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new\_constants\_in’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:202:in  
`load_file' vendor/rails/activesupport/lib/active_support/dependencies.rb:94:in `require\_or\_load’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:248:in  
`load_missing_constant' vendor/rails/activesupport/lib/active_support/dependencies.rb:453:in `const\_missing’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:465:in  
`const_missing' vendor/rails/activesupport/lib/active_support/inflector.rb:257:in `constantize’  
vendor/rails/activesupport/lib/active\_support/core\_ext/string/  
inflections.rb:148:in `constantize' vendor/rails/actionpack/lib/action_controller/routing.rb:1426:in `recognize’  
vendor/rails/actionpack/lib/action\_controller/dispatcher.rb:170:in  
`handle_request' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch’  
vendor/rails/actionpack/lib/action\_controller/dispatcher.rb:126:in  
`dispatch_cgi' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in  
`process' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `synchronize’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in  
`process' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process\_client’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process\_client’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in  
`initialize' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb: 282:in `run’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:  
281:in `each' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb: 281:in `run’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel\_rails:128:in  
`run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb: 212:in `run’  
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel\_rails:281  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:489:in  
`load' vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in `load’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in `load’  
vendor/rails/railties/lib/commands/servers/mongrel.rb:64  
/Library/Ruby/Site/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:496:in  
`require' vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new\_constants\_in’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:496:in  
`require' vendor/rails/railties/lib/commands/server.rb:39 script/server:3:in `require’  
script/server:3

This error occurred while loading the following files:  
gd2

---

<div class="post-metadata">

**Author:** ![pwever](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/87869e/32.png) [@pwever](https://www.ruby-forum.com/u/pwever)\
**Post date:** [September 30, 2008, 7:22pm UTC](https://www.ruby-forum.com/t/libjpeg-error-in-gd2/149821/2 "2008-09-30T19:22:24Z")

</div>

I am still interested in any pointers to how this might be resolved,  
but in the meantime, I switched over to ImageMagick + RMagick.  
ImageMagick installs without problems via MacPorts, RMagick via Gem  
and recreating the thumbnail generator was straight forward.

Contact me directly, if you think the source might be useful to you.  
Thanks // Pascal
