I tried installing imagemagick using homebrew on a Mac. Specifically, I did:
brew install imagemagick
in terminal. There were no error messages. When I go to use imagemagick, e.g. using the command:
magick convert
I don't see the magick command available when I try to tab complete. I'm a bit uncertain how to debug this -- it seems like it should have installed fine?
As part of installing homebrew you need to set your PATH so your shell knows where the executable binaries are installed.
Depending on your homebrew version and macOS hardware and software, you may need:
export PATH=/opt/homebrew/bin:$PATH
or
export PATH=/usr/local/bin:$PATH
You can tell which of the two commands above you need with:
find {/opt/homebrew,/usr/local}/bin -name magick
Then run:
hash -r
and all homebrew commands like magick should work for your current session.
If you want the PATH set correctly for all future sessions you will need to add the export command from above to your login profile. That will depend on your shell, but is probably:
$HOME/.zprofile
or
$HOME/.profile
Note that you should read this answer to understand why you do NOT want to use magick convert.
Related
I'm getting the following error in my development.log
[paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /tmp/stream28514-0 is not recognized by the 'identify' command.>
And i've googled about this error and i found out that many people have solved this by adding this line
Paperclip.options[:command_path] = "/usr/local/bin"
However, i still get the same error even after adding that line! I've tried everything possible!
Any help would be highly appreciated!
Regards,
Punit
The Paperclip.options[:command_path] setting is for the location of your ImageMagick executables (in this case identify). Try running which identify and setting the option to be the directory that is returned. If that command doesn't return anything, make sure that ImageMagick is properly installed.
Here is what worked for me...
I uninstalled the imagemagick that i installed from the official webpage.
I reinstalled it from sudo apt-get install imagemagick
then i did write Paperclip.options[:command_path] = "to/correct/path"
THE PROBLEM HERE WAS...
when i ran "which identify" it appearde that the path was "usr/local/bin/identify"
it means that we I was supposed to put as a path "usr/local/bin" as my path.
BUT IT DIDN'T WORKED!
I surprisingly found that i identify was also in the "usr/bin" path. So i changed:
"usr/local/bin" to "usr/bin"
And that was all!
It means that it cannot find ImageMagick's executable identify on the location you specified in Paperclip.options[:command_path] (in your case /usr/local/bin).
This is tipically caused by two reason:
It might be that you actually did not installed ImageMagick.
SOLUTION: install it:
For MAC: sudo port install ImageMagick (which installs the binary release)
For UBUNTU: sudo sudo apt-get install imagemagick
It might be that the location where you installed ImageMagick is not /usr/local/bin but something else.
SOLUTION: find where it is installed, or via the command:
which identify (in case that identify is in the current PATH, as it should be)
or via a raw find through the file system:
find / -name identify
Anyway, the usual location for those file in Ubuntu should be /usr/bin
There are two possible problems:
Image Magick is not installed or broken
Paperclip is not able to find Image Magick
Let's take them one at a time:
1. Check you have Image Magick installed and it is working
Type:
identify
at the command line, it should work. If it isn't found, or fails to work, install Image Magick. Did this fix it? If not, continue:
2. Help Paperclip find Image Magick
Type:
which identify
at the command line to get the path to the identify command. Now, in production.rb, add the following line to the configuration block:
Paperclip.options[:command_path] = "/usr/bin"
Restart your server. That should fix it.
usr/bin worked me (Fedora 14 core)
Try running the identify command in the command line and see if that gives you some error message. I found out that my server was missing some delegate libraries.
identify example.jpg
I am attempting to follow instructions on this page:
http://www.agilereasoning.com/2011/05/25/ruby-on-rails-on-windows-7-using-cygwin/
I have been trying to install Rails with varying success first using the railsinstaller and I encounter difficulties like no vim and I couldn't copy and paste from the Windows command prompt so I install CYGWIN. It didn't download the files correctly so I downloaded them manually and some were hard to locate. I couldn't find the final package as a .tar file so I downloaded libxslt-devel-1.1.20-1.i386.rpm.
Right click the Cygwin shortcut and choose edit from the menu. Change the contents to >match:
1 #echo off
2 C:\cygwin\bin\rxvt -sr -sl 1500 -e C:\cygwin\bin\bash.exe --login -i
Do I have to put this as a command to run on the executable or inside the cygwin commmand prompt? When I try to do that I get this:
-bash: 'command': command not found
Lots of things wrong here.
You can copy/paste the command prompt with Edit->Mark or Edit->Paste
libxslt-devel-1.1.20-1.i386.rpm is a linux file.
C:\cygwin\bin\rxvt - why are you mesing around with rxvt?
I recommend you install the rubyinstaller + devkit and then do gem install rails. However don't expect to be happy with rails' performance on windows.
Ruby on Rails on Windows via CYGWINTry:
Install Vagrant
Virtual Box,
and Cygwin (or PuTTy, I am using Cygwin).
With this set, open Cygwin, go to your project folder, run vagrant init <box> (my box is hashicorp/precise64 - see others)
(you may also want to cfg your Vagrantfile?). All set, Run: vagrant up and vagrant ssh
Now you have a virtual machine (Ubuntu) running, and you can install rvm (recommended... so you can have different versions of Ruby), or go directly with ruby, rails, etc.. (sudo apt-get ruby -v x.x.x,etc)
- Vagrant "creates and configures lightweight, reproducible, and portable development environments".
- Cygwin helps with ssh issues, etc...
- Virtual Box manages the machine (Ubuntu, or other OS)
With this set, I have no problem at all running Ruby (on Rails) with Windows.
I have installed ImageMagick through apt-get in Ubuntu 12.04. Now I need to enable HDRI support for my ImageMagick scripts. How can I do that?
You should run
convert -list configure | grep FEATURES
If the result does not list HDRI, then you need to get a different build of ImageMagick. Your current one will not support it (it cannot be "added in" by the simple change of a local configuration setting).
Either build it yourself from sources, or ask your Ubuntu package maintainer in the most friendly way you can to provide an alternative build.
It's possibly still disabled in Ubuntu because the ImageMagick developer themselves call it an "experimental feature".
I installed RefineryCMS on my server(CentOs 5.5) and everything works fine except uploading images. It will show an error like:
NoMethodError in Refinery::Admin::ImagesController#create
undefined method `downcase' for nil:NilClass
I installed ImageMagick by typing:
sudo yum install ImageMagick
I searched online and it seems ImageMagick installed by yum is too old (Version 6.2.x)
Then I removed it, successfully installed ImageMagick v6.7.7 from source code.
Now when I try to upload an image, refinery shows:
Dragonfly::Shell::CommandFailed in Refinery::Admin::ImagesController#create
Command failed (identify '/tmp/RackMultipart20120628-29239-70xr45') with exit status 127
However, if I run that command "identify '/tmp/RackMultipart20120628-29239-70xr45'" in the command line, it will show the result without any error. It seems that Dragonfly can not pick up my installation of the lastest version of ImageMagick. Could any one tell me how to configure it ? Or should I upgrade my centOS ?(I wish not)
Well, I have struggled with this issue for more than one week.
I also asked this question in Github and finally got the solution there.
see: https://github.com/resolve/refinerycms/issues/1781#issuecomment-6823858
Since this problem is caused by that Dragonfly can not find imagemagick.
You can try add the following code to config/application.rb
initializer 'override-image-magick-paths', :after => 'attach-refinery-images-with- dragonfly' do
app=Dragonfly[:refinery_images]
app.configure_with(:imagemagick)
app.configure do |c|
c.convert_command = "/usr/local/bin/convert" # defaults to "convert"
c.identify_command = "/usr/local/bin/identify" # defaults to "identify"
end
end
Modify the path according to your imagemagick installation.
You can use which command to find the path. e.g. which convert
However, this still doesn't work for me.
And finally, toymachiner62 find a solution which is simple and works perfect.
That is to use symbolic link:
$ cd /usr/bin
$ ln -s /usr/local/bin/convert convert
$ ln -s /usr/local/bin/identify identify
modify the /usr/local/bin/convert paths to you installation as well.
This looks like my /usr/local/bin path is not in my $PATH, but actually it is.
Dragonfly just seems can not find it anyway.
I'm getting the following error in my development.log
[paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /tmp/stream28514-0 is not recognized by the 'identify' command.>
And i've googled about this error and i found out that many people have solved this by adding this line
Paperclip.options[:command_path] = "/usr/local/bin"
However, i still get the same error even after adding that line! I've tried everything possible!
Any help would be highly appreciated!
Regards,
Punit
The Paperclip.options[:command_path] setting is for the location of your ImageMagick executables (in this case identify). Try running which identify and setting the option to be the directory that is returned. If that command doesn't return anything, make sure that ImageMagick is properly installed.
Here is what worked for me...
I uninstalled the imagemagick that i installed from the official webpage.
I reinstalled it from sudo apt-get install imagemagick
then i did write Paperclip.options[:command_path] = "to/correct/path"
THE PROBLEM HERE WAS...
when i ran "which identify" it appearde that the path was "usr/local/bin/identify"
it means that we I was supposed to put as a path "usr/local/bin" as my path.
BUT IT DIDN'T WORKED!
I surprisingly found that i identify was also in the "usr/bin" path. So i changed:
"usr/local/bin" to "usr/bin"
And that was all!
It means that it cannot find ImageMagick's executable identify on the location you specified in Paperclip.options[:command_path] (in your case /usr/local/bin).
This is tipically caused by two reason:
It might be that you actually did not installed ImageMagick.
SOLUTION: install it:
For MAC: sudo port install ImageMagick (which installs the binary release)
For UBUNTU: sudo sudo apt-get install imagemagick
It might be that the location where you installed ImageMagick is not /usr/local/bin but something else.
SOLUTION: find where it is installed, or via the command:
which identify (in case that identify is in the current PATH, as it should be)
or via a raw find through the file system:
find / -name identify
Anyway, the usual location for those file in Ubuntu should be /usr/bin
There are two possible problems:
Image Magick is not installed or broken
Paperclip is not able to find Image Magick
Let's take them one at a time:
1. Check you have Image Magick installed and it is working
Type:
identify
at the command line, it should work. If it isn't found, or fails to work, install Image Magick. Did this fix it? If not, continue:
2. Help Paperclip find Image Magick
Type:
which identify
at the command line to get the path to the identify command. Now, in production.rb, add the following line to the configuration block:
Paperclip.options[:command_path] = "/usr/bin"
Restart your server. That should fix it.
usr/bin worked me (Fedora 14 core)
Try running the identify command in the command line and see if that gives you some error message. I found out that my server was missing some delegate libraries.
identify example.jpg