# My GD2 is not working

**URL:** <https://www.ruby-forum.com/t/my-gd2-is-not-working/58848>\
**Category:** Rails\
**Created:** [April 26, 2006, 3:30pm UTC](https://www.ruby-forum.com/t/my-gd2-is-not-working/58848 "2006-04-26T15:30:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomingy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/df788c/32.png) [@tomingy](https://www.ruby-forum.com/u/tomingy)\
**Post date:** [April 26, 2006, 3:30pm UTC](https://www.ruby-forum.com/t/my-gd2-is-not-working/58848/1 "2006-04-26T15:30:58Z")

</div>

I installed GD2 1.0/1.1, but they are both not working, does anyone  
knows why? Great Thanks!

# With GD 1.0 I got:

RuntimeError  
unknown symbol “gdImageSquareToCircle”  
RAILS\_ROOT:  
/home/virtual/site1/fst/var/www/html/imodesite/public/…/config/…

Application Trace | Framework Trace | Full Trace  
/usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122:in `[]' /usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`inject’  
/usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in`require’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems.rb:182:in `activate' /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:181:in`activate’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems.rb:37:in  
`require_gem_with_options' /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:31:in`require\_gem’  
#{RAILS\_ROOT}/app/helpers/application\_helper.rb:2  
#{RAILS\_ROOT}/app/controllers/application.rb:3  
/usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122:in `[]' /usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`inject’  
/usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in`require’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems.rb:182:in `activate' /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:181:in`activate’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems.rb:37:in  
`require_gem_with_options' /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:31:in`require\_gem’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:140:in  
`load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in`require\_or\_load’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:30:in  
`depend_on' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in`require\_dependency’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/helpers.rb:114:in  
`default_helper_module!' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/helpers.rb:127:in`inherited\_without\_api’  
/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action\_web\_service/container/action\_controller\_container.rb:86:in  
`inherited_without_action_controller' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:34:in`inherited’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:140:in  
`load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in`require\_or\_load’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:30:in  
`depend_on' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in`require\_dependency’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:69:in  
`prepare_application' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:37:in`dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:150:in  
`process_request' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:54:in`process!’  
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:600:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:597:in`each\_cgi’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:53:in  
`process!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in`process!’  
/home/virtual/site1/fst/var/www/html/imodesite/public/dispatch.fcgi:24  
/usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122:in `[]' /usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in`inject’  
/usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in`require’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems.rb:182:in `activate' /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:181:in`activate’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems.rb:37:in  
`require_gem_with_options' /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:31:in`require\_gem’  
#{RAILS\_ROOT}/app/helpers/application\_helper.rb:2  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:140:in  
`load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in`require\_or\_load’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:30:in  
`depend_on' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in`require\_dependency’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/helpers.rb:114:in  
`default_helper_module!' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/helpers.rb:127:in`inherited\_without\_api’  
/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action\_web\_service/container/action\_controller\_container.rb:86:in  
`inherited_without_action_controller' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:34:in`inherited’  
#{RAILS\_ROOT}/app/controllers/application.rb:3  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:140:in  
`load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in`require\_or\_load’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:30:in  
`depend_on' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in`require\_dependency’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:69:in  
`prepare_application' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:37:in`dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:150:in  
`process_request' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:54:in`process!’  
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:600:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:597:in`each\_cgi’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:53:in  
`process!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in`process!’  
/home/virtual/site1/fst/var/www/html/imodesite/public/dispatch.fcgi:24  
This error occured while loading the following files:  
application.rb  
application\_helper.rb  
gd2

# With GD 1.1, I got

NameError in ProductController#product\_image  
uninitialized constant SYM  
RAILS\_ROOT:  
/home/virtual/site1/fst/var/www/html/imodesite/public/…/config/…

Application Trace | Framework Trace | Full Trace  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:123:in  
`const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in`const\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2/image.rb:120:in `load' #{RAILS_ROOT}/app/helpers/application_helper.rb:46:in`resize\_image’  
#{RAILS\_ROOT}/app/controllers/product\_controller.rb:387:in  
`draw_image_for' #{RAILS_ROOT}/app/controllers/product_controller.rb:149:in`product\_image’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:123:in  
`const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in`const\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2/image.rb:120:in `load' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in`perform\_action\_without\_filters’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/filters.rb:368:in  
`perform_action_without_benchmark' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in`perform\_action\_without\_rescue’  
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in`perform\_action\_without\_rescue’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/rescue.rb:82:in  
`perform_action' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in`process\_without\_filters’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/filters.rb:377:in  
`process_without_session_management_support' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in`process’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in  
`dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in`process\_request’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:54:in  
`process!' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:600:in`each\_cgi’  
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:597:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in`process!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:23:in  
`process!' /home/virtual/site1/fst/var/www/html/imodesite/public/dispatch.fcgi:24 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in`const\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:133:in  
`const_missing' /usr/local/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2/image.rb:120:in`load’  
#{RAILS\_ROOT}/app/helpers/application\_helper.rb:46:in `resize_image' #{RAILS_ROOT}/app/controllers/product_controller.rb:387:in`draw\_image\_for’  
#{RAILS\_ROOT}/app/controllers/product\_controller.rb:149:in  
`product_image' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in`perform\_action\_without\_filters’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/filters.rb:368:in  
`perform_action_without_benchmark' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in`perform\_action\_without\_rescue’  
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in`perform\_action\_without\_rescue’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/rescue.rb:82:in  
`perform_action' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in`process\_without\_filters’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/filters.rb:377:in  
`process_without_session_management_support' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in`process’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in  
`dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in`process\_request’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:54:in  
`process!' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:600:in`each\_cgi’  
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:597:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in`process!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:23:in  
`process!’  
/home/virtual/site1/fst/var/www/html/imodesite/public/dispatch.fcgi:24  
This error occured while loading the following files:  
gd2/sym.rb

---

<div class="post-metadata">

**Author:** ![tomingy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/df788c/32.png) [@tomingy](https://www.ruby-forum.com/u/tomingy)\
**Post date:** [April 26, 2006, 3:45pm UTC](https://www.ruby-forum.com/t/my-gd2-is-not-working/58848/2 "2006-04-26T15:45:03Z")

</div>

tomingy writes:

> I installed GD2 1.0/1.1, but they are both not working, does anyone  
> knows why? Great Thanks!
> 
> # With GD 1.0 I got:
> 
> RuntimeError  
> unknown symbol “gdImageSquareToCircle”  
> RAILS\_ROOT:  
> /home/virtual/site1/fst/var/www/html/imodesite/public/…/config/…

This message I’ve seen before. (The GD-1.1 message, I haven’t). I  
got it when the GD gem was having trouble locating the GD shared  
library (the .so file). It was as if something within Rails was  
messing with LD\_LIBRARY\_PATH; I worked around it by doing

require ‘rubygems’  
require\_gem ‘GD2’

in environment.rb _before_ it invokes Rails::Initializer.run.  
(Which still requires libgd.so to exist in a place where  
a search along LD\_LIBRARY\_PATH can find it).

rst

---

<div class="post-metadata">

**Author:** ![tomingy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/df788c/32.png) [@tomingy](https://www.ruby-forum.com/u/tomingy)\
**Post date:** [May 1, 2006, 2:55am UTC](https://www.ruby-forum.com/t/my-gd2-is-not-working/58848/3 "2006-05-01T02:55:34Z")

</div>

Robert Thau wrote:

> This message I’ve seen before. (The GD-1.1 message, I haven’t). I  
> got it when the GD gem was having trouble locating the GD shared  
> library (the .so file). It was as if something within Rails was  
> messing with LD\_LIBRARY\_PATH; I worked around it by doing
> 
> require ‘rubygems’  
> require\_gem ‘GD2’
> 
> in environment.rb _before_ it invokes Rails::Initializer.run.  
> (Which still requires libgd.so to exist in a place where  
> a search along LD\_LIBRARY\_PATH can find it).
> 
> rst

Hi Robert, thanks for your response.  
I have tested the GD2-Gem both 1.0 and 1.1 with the following

* * *

Testing File: testgd2.rb

#!/usr/bin/ruby  
require ‘rubygems’  
require\_gem ‘gd2’  
include GD2

## image = Image.import(’./test.png’) image.resize! 200, 300 image.export(‘new-image.png’)

Result 1 - FAILED with both GD2 1.0 & 1.1:  
flowersa@antinous [~]# ruby -v  
ruby 1.8.4 (2005-12-24) [i386-linux]

flowersa@antinous [~]# rails -v  
Rails 1.0.0

flowersa@antinous [~]# ruby testgd2.rb  
/usr/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122:in `[]': unknown symbol "gdFTUseFontConfig" (Runti meError) from /usr/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122 from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in`inject’  
from /usr/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:122  
from /usr/lib/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require' from /usr/lib/site_ruby/1.8/rubygems.rb:182:in`activate’  
from /usr/lib/site\_ruby/1.8/rubygems.rb:181:in `activate' from /usr/lib/site_ruby/1.8/rubygems.rb:37:in`require\_gem\_with\_options’  
from /usr/lib/site\_ruby/1.8/rubygems.rb:31:in `require\_gem’  
from testgd2.rb:5

* * *

Result 2 - SUCCESSED with GD2 1.0:

[vs140728@svc037 vs140728]$ ruby -v  
ruby 1.8.2 (2004-12-25) [i686-linux]

[vs140728@svc037 vs140728]$ rails -v  
Rails 0.14.3

* * *

It seems something wrong with GD2 with new version of Ruby??

Does anyone know how to fix this?

Great thanks.  
myy

---

<div class="post-metadata">

**Author:** ![tomingy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/df788c/32.png) [@tomingy](https://www.ruby-forum.com/u/tomingy)\
**Post date:** [May 3, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/my-gd2-is-not-working/58848/4 "2006-05-03T18:57:01Z")

</div>

Guest writes:

> It seems something wrong with GD2 with new version of Ruby??

I don’t think that’s it — I’ve used it successfully with Ruby 1.8.4.  
But this sort of problem could arise if Ruby 1.8.2 and 1.8.4 were  
compiled  
with different config flags.

Once again, I’d check for libgd.so on LD\_LIBRARY\_PATH … but that is  
just a guess.

Robert Thau  
removed\_email\_address@domain.invalid
