# RMagick and ugly error

**URL:** <https://www.ruby-forum.com/t/rmagick-and-ugly-error/93000>\
**Category:** Rails\
**Created:** [April 26, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/rmagick-and-ugly-error/93000 "2007-04-26T14:09:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![flip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@flip](https://www.ruby-forum.com/u/flip)\
**Post date:** [April 26, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/rmagick-and-ugly-error/93000/1 "2007-04-26T14:09:24Z")

</div>

Not sure if this is the right place to ask this but I know allot of  
you are using either scruffy or gruff to generate graphs. I am running  
on a macbook pro with macports of ruby 1.8.5 rails edge imagemagick  
rmagick and trying to get either scruffy or gruff to work. my issue is  
that I can’t seem to get either of them to work on this combination  
and can’t figure out why. I have the following error in my mongrel  
log:

/opt/local/lib/ruby/gems/1.8/gems/scruffy-0.2.2/lib/scruffy/  
rasterizers/rmagick\_rasterizer.rb:16: [BUG] Bus Error  
ruby 1.8.5 (2006-08-25) [i686-darwin8.8.2]

Here is how I am trying to make the graph:

View

\<%= image\_tag graph\_url(:action =\> ‘collection\_worth’, :id =\> 42) %\>

controller:

def collection\_worth  
graph = Scruffy::Graph.new(:title =\> “Monthly Profits”, :theme =\>  
Scruffy::Themes::RubyBlog.new)  
graph \<\< Scruffy::Layers::Line.new(:title =\> ‘John’, :points =\>  
[100, -20, 30, 60])  
graph \<\< Scruffy::Layers::Line.new(:title =\> ‘Sara’, :points =\>  
[120, 50, -80, 20])

```
send_data(graph.render(:width => 800, :as => 'PNG'), :type =>

```

‘image/png’, :disposition=\> ‘inline’)  
end

as you can se nothing special right now just trying to get a graph to  
draw. (I have a route set up so that is not the issue in routes.rb as  
well) rails is going out and trying to build the graph but nothing is.

I am also using attachment\_fu and it successfully uses rmagick to  
create thumbnails for various images as well. Any thoughts?  
imagemagick is version ImageMagick @6.3.0-3\_0+darwin\_8 (active) and  
rmagick is version rmagick-1.15.3

hope that someone can help my only guess is that I am using a bad  
combination of rmagick and imagemagick but I have no idea what the  
correct combination is in order to get scruffy (prefered graphing  
library) and attachment\_fu to do exactly what they are supposed to  
with ruby 1.8.5 and rails/mongrel

---

<div class="post-metadata">

**Author:** ![flip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@flip](https://www.ruby-forum.com/u/flip)\
**Post date:** [April 26, 2007, 4:00pm UTC](https://www.ruby-forum.com/t/rmagick-and-ugly-error/93000/2 "2007-04-26T16:00:42Z")

</div>

hi,  
try using minimagick…link is  
[http://clarkware.com/cgi/blosxom/2007/02/24#FileUploadFu...see](http://clarkware.com/cgi/blosxom/2007/02/24#FileUploadFu...see) if it  
helps  
-ciao  
AG

---

<div class="post-metadata">

**Author:** ![flip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@flip](https://www.ruby-forum.com/u/flip)\
**Post date:** [April 26, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/rmagick-and-ugly-error/93000/3 "2007-04-26T17:56:02Z")

</div>

I tried playing around with scruffy and trying to use MiniMagick with  
it however I can’t seem to get it to work. attachment\_fu works  
perfectly but scruffy is not to happy with trying to use it. It seems  
that MiniMagick does not have a to\_blob function and I can’t seem to  
find it in the source of rmagick either but need to look at it a  
little deeper. Any other suggestions from others? What is the right  
combination of imagemagick and rmagick to use to satisfy both scruffy  
and attachment\_fu?

thanks again  
Andrew

---

<div class="post-metadata">

**Author:** ![flip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@flip](https://www.ruby-forum.com/u/flip)\
**Post date:** [April 26, 2007, 10:17pm UTC](https://www.ruby-forum.com/t/rmagick-and-ugly-error/93000/4 "2007-04-26T22:17:31Z")

</div>

Matthew thanks for the help. Upgrading ruby as well as compiling  
rmagick and imagemagick from source fixed my issue. Not sure what is  
wrong with the imagemagick macport but that seems to have been the  
culprit (the latest one doesn’t uninstall pretty leaves everything  
behind) at least on my machine it does and it took some time to find  
it all and manually delete it. But now all is well in graph land for  
me as well as attachment\_fu is happily doing its thing

Flip

On Apr 26, 1:24 pm, Matthew I. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![flip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@flip](https://www.ruby-forum.com/u/flip)\
**Post date:** [April 26, 2007, 7:24pm UTC](https://www.ruby-forum.com/t/rmagick-and-ugly-error/93000/5 "2007-04-26T19:24:55Z")

</div>

flip wrote:

> ror in my mongrel  
> log:
> 
> /opt/local/lib/ruby/gems/1.8/gems/scruffy-0.2.2/lib/scruffy/  
> rasterizers/rmagick\_rasterizer.rb:16: [BUG] Bus Error  
> ruby 1.8.5 (2006-08-25) [i686-darwin8.8.2]

Bus Errors shouldn’t happen. I’d try updating to ruby 1.8.6 (it is in  
MacPorts).If that still doesn’t work, try building rmagick with  
GraphicsMagick instead of ImageMagick. I’m not sure of the macport gives  
you that option, but it is something to try even if you have to build it  
manually.

-matthew
