Entries tagged with “ImageMagick”.
Did you find what you wanted?
Thu 22 Dec 2011
Problem
You want to use the rmagick gem in your rails application after a new (K)ubuntu system installation, but the bundler command gives you errors.
Solution
Install the following before running budler again:
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
Fri 17 Jun 2011
Problem
You want to use the rmagick gem in your ruby on rails project, but you need to install the imagemagick first.
Solution
If Imagemagick is not already installed, use the following to install it:
$ sudo apt-get install imagemagick
Then install the development librarires for both the imagemagick and the MagickWand as in:
$ sudo apt get install libmagick-dev libmagickwand-dev
You should then be able to install and use the rmagick gem
Fri 17 Jun 2011
Problem
You want to use the rmagick gem in your ruby on rails project, but you need to install the imagemagick first.
Solution
If Imagemagick is not already installed, use the following to install it:
$ sudo urpmi imagemagick
Then install the development library for the 64bit version as in:
$ sudo urpmi lib64magick-devel
You should then be able to install and use the rmagick gem
Thu 18 Mar 2010
Problem
You have just deployed your rails application to dreamhost but you are getting this error from passenger.
Solution
There was a change in the ImageMagic between versions 6.4.3 and 6.4.4 from the affinity function to remap.
If you don’t want, or don’t have time to recompile the ImageMagick and install the rmagick gem, you can comment out the two declarations for the alias functions, located around lines 782 and 1525 in the file rmagick-2.12.2/lib/RMagick.rb:
alias_method :affinity, :remap
Wed 9 Sep 2009
Posted by kosmas under ruby on rails
No Comments
Problem
You want to generate pdf documents in your Ruby on Rails app using .doc templates.
Solution
Open the .doc document in OpenOffice and save it as an Open Document Format (.odt).
Open the saved .odt document and export to pdf, making sure you use ‘Losless compression’ in the General Options section.
Use imagemagick’s convert to make the pdf file to an image (setting the density to your requirements – default is 72dpi):
convert -density 150 one.pdf one.png
Copy the image one.png to your rails image directory (public/images).
Use the image as a background to the pdf created by prawnto (install plugin if you don’t have it) with:
templ=”#{RAILS_ROOT}/public/images/one.png”
pdf.image(templ, {:position => :center, :vposition => :top, :scale => 0.215})
Put the database field(s) text on position (you’ll have to play around with the coordinates to get it right), like:
pdf.font “#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf”, :size => 9
pdf.text “#{@model_name.fielda_name}”, :at => [100,530]
pdf.text “#{@model_name.fieldb_name}”, :at => [100,510] …