Topic: Paperclip Error with Spree - imagemagick not installed properly?

Running Spree commerce. I have finished my extension and have made it live on my hardy slicehost server. The problem is that when I try to upload images I get this error.

Paperclip::NotIdentifiedByImageMagickError in Admin/imagesController#create

  /tmp/stream.24717.0 is not recognized by the 'identify' command.

From what I understand this mean that imagemagick is not installed properly. I installed imagemagic from binary to /usr/local/bin and then did sudo gem install RMagick. Still getting the error. Does anyone know why I might be getting this, driving my crazy and holding me up. Thanks!

Re: Paperclip Error with Spree - imagemagick not installed properly?

Good to see almost a year later no-one's answered sad.

I'm having the exact same trouble. ImageMagick defintely installed,  path to 'identify' added to paperclip.rb under initializers folder.

Best part... this is on the Spree Bitnami Ubuntu VMWare stack... which means it never worked, and nobody tested it properly. hmm

Re: Paperclip Error with Spree - imagemagick not installed properly?

dug - From what I can see the Bitnami stack is using Spree 0.9.4, which is over a year old. Spree has been evolving very fast lately, switching to Rails 3 and doing a lot of code restructuring. I'd strongly recommend installing the latest version (currently 0.50) - it only takes about 5 minutes of setup from a vanilla Rails 3 app

Re: Paperclip Error with Spree - imagemagick not installed properly?

Hi pogodan, thx for the reply. smile

I was forced to try the Bitnami Spree stack as all other attempts to get more recent versions of Spree running properly on ANY platform ( OpenSuse,  Ubuntu, even Windows ) have failed for numerous painful reasons. I even tried, simply, 'gem update spree' on a fresh Bitnami Spree stack. All it did was break it!

What's the odds that if I fire up yet another VM based on a Ubuntu / Rails stack Spree will actually a) install, and b) work without reporting some incorrect version gem, which requires building from source, from an obscure lib file located on some near impossible to find repository?

Thought I'd ask before I go through that tediom for about the 100th time! wink

Re: Paperclip Error with Spree - imagemagick not installed properly?

dug - We've had good luck so far running Spree on Mac, CentOS 5 and Ubuntu 10.10. It does have a large list of dependencies so some of that stuff can be a bit tricky to get working (ImageMagick/RMagick certainly always being a bit of a PITA)

A simple from-scratch ubuntu setup looks more or less like this:

sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl \
  git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 \
  libxml2-dev libxslt-dev autoconf libcurl4-openssl-dev xml-core \ 
  imagemagick imagemagick graphicsmagick libmagickcore-dev libmagickwand-dev \
  mysql-client  libmysql-ruby libmysqlclient-dev -y

Notice you're not installing ruby whatsoever. After that it's basically  (run as a non-root user):

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )
rvm install 1.9.2
rvm use 1.9.2 --default
rvm use 1.9.2@global
gem install bundler passenger
rvmsudo passenger-install-nginx-module

Just accept the defaults for that and you've basically got a working ruby installation. I'd then setup a new Rails app with its own gemset(.rvmrc), add spree to the Gemfile and run bundle install, and you should be just about ready to go (you'll need to setup a vhost and do some other admin stuff, but these few commands are pretty much a core working ubuntu ruby install)

Re: Paperclip Error with Spree - imagemagick not installed properly?

Hi pogodan.

Well... I finally got to try it. I even got my hopes up when the first steps on a fresh Ubuntu 10.10 install didn't crash and burn spectacularly. It was all downhill from there.

First I came up against the RVM install problem ( where you need to add it to your bash profile ), then instead of a smooth install at 'rvm install 1.9.2' I got the imagemagick dummy spit.

I installed it manually and re-ran the install and it seemed to complete successfully.

Then when I ran 'gem install bundler passenger' I get

ERROR: Loading command: install (LoadError) no such file to load --zlib

So then I went and tried installing zlib:

rvm package install zlib

Which went fine, so then I ran

rvm remove 1.9.2

then ran

rvm install 1.9.2 --with-zlib-dir=~/.rvm/usr

which failed, but was successful when I ran, instead

rvm install 1.9.2 -- with-zlib-dir=./.rvm/src/ruby-1.9.2-p180/ext/zlib

I then tried

gem install bundler passenger

again, and got the same 'no such file to load -- zlib' error. So zlib obviously isn't installed and cannot be.

So yup... entirely consistent with my experience with RoR thus far, e.g. flakey, time consuming and ultimately unsatisfying. sad

[edit]

ok... I found and ran this:

sudo apt-get install zlib1g-dev libssl-dev libreadline5-dev libxml2-dev libsqlite3-dev

then ran

rvm remove 1.9.2

then manually deleted all 1.9.2 dir's and files

then ran

rvm install 1.9.2

THEN

gem install bundler ( worked, so then )

gem install bunder passenger

which was finally successful.

Prior to this I had been down a dozen blind alleys, including building required zlib stuff from source (grrr).

Now anticipating and waiting for next roadblock...

hmm

Last edited by dug (2011-04-02 07:23:56)