From: Lance Squire Date: 2006-08-05T02:08:13+09:00 Subject: Re: Ruby can't see RMagick installed from gem on FC4 unknown wrote: >> Magick >> ---- > > therefore, you've got it installed. if you are having issues with rails > you > have issues with permissions or you have two rubys installed and the web > users > is using a different one > This may or may not have happened when I tried to upgrade the version of rails. Don't know how to check and or rectify... > > anyhow. you have installed RMagick and can use it fine from the command > line. > what's your exact issue in rails then? > Trying to use Rmagick to make thumbnails of images previously stored on the drive. You've seen the errors above. here is the code as it stands now: def make_thumb(location, image, thumb) require 'rubygems' require_gem 'rmagick' include Magick pic = Magick::Image.read("#{location}#{image}") imgwidth = pic.columns imgheight = pic.rows imgratio = imgwidth.to_f / imgheight.to_f imgratio > aspectratio ? scaleratio = 64 / imgwidth : scaleratio = 64 / imgheight thumb = pic.resize(scaleratio) white_bg = Magick::Image.new(64, thumb.height) pic = white_bg.composite(thumb, Magick::CenterGravity, Magick::OverCompositeOp) pic.write("#{location}#{thumb}") end modified from this site: http://www.bigbold.com/snippets/tag/rmagick (bottom 2 examples) Lance -- Posted via http://www.ruby-forum.com/.