filepath in identify for paperclip cygwin

D

Dan Quach

Hi there,

I am using paperclip with imagemagick and i get the error

[paperclip] An error was received while processing:
#<Paperclip::NotIdentifiedBy
ImageMagickError: C:/Users/shinzu/slide,8724,0.jpg is not recognized by
the 'ide
ntify' command.>

I set-up some more debugging to see what was going on, and I saw
something weird going on in the actual identify call command:

/usr/local/home/ImageMagick/ImageMagick-6.5.9/bin/identify -format
"%wx%h" "C:/Users/shinzu/slide,8724,0.jpg"[0]

Here, it uses "C:/users/shinzu" which is totally incorrect for cygwin.
I also noticed that this is where files were being uploaded to
temporarily

Question: What is the environment variable responsible for uploading
temporary files like this? I need to make sure c:/users/shinzu is
\cygdrive\c\users\shinzu

thanks!
-dan
 
K

Kasper F.

Dan Quach wrote in post #889421:
Here, it uses "C:/users/shinzu" which is totally incorrect for cygwin.
I also noticed that this is where files were being uploaded to
temporarily

Question: What is the environment variable responsible for uploading
temporary files like this? I need to make sure c:/users/shinzu is
\cygdrive\c\users\shinzu

thanks!
-dan

I had the same problem, and it took me 3 weeks to solve.
You have to change the temp file path.
In enviroment.rb write:
ENV['TMPDIR'] = '/cygdrive/c/users/shinzu'

and remeber this line (I have made a file called paperclip.rb in the
initializers folder:
Paperclip.options[:command_path] = "/usr/local/bin"
 
L

Luis Lavena

Dan Quach wrote in post #889421:


Here, it uses "C:/users/shinzu" which is totally incorrect for cygwin.
I also noticed that this is where files were being uploaded to
temporarily
Question: What is the environment variable responsible for uploading
temporary files like this?  I need to make sure c:/users/shinzu is
\cygdrive\c\users\shinzu
thanks!
-dan

I had the same problem, and it took me 3 weeks to solve.
You have to change the temp file path.
In enviroment.rb write:
ENV['TMPDIR'] = '/cygdrive/c/users/shinzu'

Question, are you using cygwin Ruby or native Ruby? because
File.expand_path of cygwin will return the proper cygdrive while
mixing native RUby with cygwin libraries will not work.
 
R

Robert Klemme

No, you want

/cygdrive/c/users/shinzu

If you use backslash you need to include two per backslash in a file name:

name =3D "C:\\foo\\bar"
I had the same problem, and it took me 3 weeks to solve.
You have to change the temp file path.
In enviroment.rb write:
ENV['TMPDIR'] =3D '/cygdrive/c/users/shinzu'

Question, are you using cygwin Ruby or native Ruby? because
File.expand_path of cygwin will return the proper cygdrive while
mixing native RUby with cygwin libraries will not work.

And if you mix you can use cygpath command for path conversions.

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top