Archive | September, 2008

RMagick.so pain

17 Sep

We are using rmagic 1.15.11 gem which is inside our source tree.

On CentOS i had installed:
rpm -qa | grep -i magick
ImageMagick-devel-6.4.3-6
ImageMagick-c++-6.4.3-6
ImageMagick-c++-devel-6.4.3-6
ImageMagick-6.4.3-6

But when i tried to run mongrel I got:

#<noMethodError: undefined method `configuration' for #>
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- RMagick.so (MissingSourceFile)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /home/jtsoong/chipmeup/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:509:in `require'
from /home/jtsoong/chipmeup/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:354:in `new_constants_in'

I then downloaded the tar ball of ImageMagick (the same version 6.4.3-6) and installed that (straight ./configure; make; make install)

I then got this error:
/usr/lib/ruby/gems/1.8/gems/rmagick-2.6.0/lib/RMagick.so: /usr/lib/ruby/gems/1.8/gems/rmagick-2.6.0/lib/RMagick.so: undefined symbol: Init_RMagick - /usr/lib/ruby/gems/1.8/gems/rmagick-2.6.0/lib/RMagick.so (LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
from /home/jtsoong/chipmeup/vendor/rails/activerecord/lib/../../activesupport/lib/act

To fix this I linked in the new RMagick.so (in actual fact the new gem had created RMagick2.so):

sudo ln -s /usr/lib/RMagick.so /usr/lib/ruby/gems/1.8/gems/rmagick-2.6.0/lib/RMagick.so

A gem list shows the gem installed:

rmagick (2.6.0)

This now works, but is an ugly hack..

Sendmail erros

15 Sep

I was receiving:”dsn=5.6.0, stat=Data format error” in maillogs for certain addresses…

To get more information do:

( echo subject: test; echo ) | sendmail -Am -v -f admin@mydomain.com

This might end up telling you that you’re on a DNS block list.

Rails setup

10 Sep

1. Get source code from repository
2. Install Ruby
3. Get RubyGems tarball from rubyforge.org
4. Explode tarball, run “ruby setup.rb” – this will install gems
5. Install mongrel: “gem install mongrel”
6. To run mongrel: “mongrel_rails start”

Note if there are complaints about RMagick/ImageMagick:
(e.g.: “/usr/lib/ruby/gems/1.8/gems/rmagick-2.5.2/lib/RMagick2.so: libMagickCore.so.1: cannot open shared object file: No such file or directory – /usr/lib/ruby/gems/1.8/gems/rmagick-2.5.2/lib/RMagick2.so (LoadError)”)

  • Get the ImageMagick tarball
  • cd ImageMagick-xxx
  • ./configure
  • make
  • sudo make install
  • sudo gem install rmagick
  • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
  • mongrel_rails start

Group Ownership of files

9 Sep

If you want group ownership of all files created in a directory do:

chmod -R g+s myfolder