why doesn't 'which identify' work for ImageMagick on Windows machine? - windows

I'm trying to get paperclip and ImageMagick to work on a Windows 7 machine using Ruby 1.9.2 and rails 3.0.7. ImageMagick appears to have installed fine, since I did the imdisplay command that the ImageMagick installer told me to do, and it worked. A basic paperclip attachment also works fine, as long as I'm not trying to resize it. Once I do try to resize, I get the "...[image path] is not recognized by the 'identify' command" error. There are several posts about this, here are the things I've done from reading those:
ImageMagick is installed in a directory w/out spaces - C:\ImageMagick-6.5.6-Q8
ImageMagick is on my PATH - I can do identify -version and get the version info.
I've added the following to my config/environments/development.rb :
Paperclip.options[:command_path] = "C:/ImageM~1"
I also tried that with the full path, until another post suggested the ~ abbreviation.
Suggestions?

Related

Ruby 'cannot load such file --RMagick'

I have a default installation of a jekyll project (created with jekyll new sample) and have included a plugin, JekyllGalleryTag.
The plugin depends upon ImageMagick and RMagick. I have installed ImageMagick and RMagick successfully on Xubuntu 14.04 using these commands.
sudo apt-get update
sudo apt-get install imagemagick --fix-missing
sudo apt-get install libmagickcore-dev
sudo apt-get install libmagickwand-dev
ImageMagick commands are functional, eg convert logo.gif logo.jpg works as expected.
I am running ruby-2.3.0 via rvm 1.27.0
gem install rmagick
RMagick installs without any error messages.
JekyllGalleryTag needs galleries.rb put in /_plugins, which I have done. The first line of galleries.rb reads ...
require 'RMagick'
The plugin requires some code in _config.yml, which looks like this...
gallerytag:
dir: images/galleries
url: /images/galleries
thumb_width: 150
thumb_height: 150
columns: 4
My gallery images are located in /images/galleries/dig/
I created an html file with some Liquid code to display the result. Here's the code in dig.html
---
layout: default
title: Dig In Italy
---
{% gallery dig %}
dig/current001.jpg:: A caption goes here!
{% endgallery %}
When I preview the site, with jekyll serve, I get this error message...
Configuration file: /mnt/hgfs/proj/practice/jekyll/sample/_config.yml
Dependency Error: Yikes! It looks like you don't have /mnt/hgfs/proj/practice/jekyll/sample/_plugins/galleries.rb or one of its dependencies installed.
In order to use Jekyll as currently configured, you'll need to install this gem.
The full error message from Ruby is: 'cannot load such file -- RMagick'
If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
jekyll 3.1.6 | Error: /mnt/hgfs/proj/practice/jekyll/sample/_plugins/galleries.rb
I am new to ruby, jekyll, and linux generally. I have googled and read and experimented for hours searching for a fix. The summarized sequence above is a result of all that research. I have installed every suggested library.
Other fixes I tried and discarded were:
including require 'rubygems' as the first line in galleries.rb (in addition to require 'RMagick')
require 'rmagick' instead of require 'RMagick'
all 4 combinations of these require statements
Additional wrinkles that may be relevant or not;
Xubuntu 14.04 is running in VMware Player 7.1.2
The host OS is Windows 7 Pro 64 bit.
My jekyll files are on the host NTFS filesystem, and I've been editing them with Notepad++ (a windows editor). The files are shared with the guest OS via VMware Player's Shared Folders option. This arrangement works fine for static sites and WordPress sites.
I am using the terminal in the guest OS, Xubuntu, for all command line work. The Xubuntu OS contains the AMP stack, along with rvm and ruby.
Though bundler is installed, I did not use it to install RMagick.
How do I fix this?
UPDATE:
I have verified that RMagick is working properly. I made a couple of small .rb scripts from the code on the RMagick Usage page. Two identical script sets were stored, one in the linux filesystem, and one in the NTFS filesystem. Both execute as expected without errors. This demonstrates that ruby works and can find and use RMagick, and that RMagick can find and use ImageMagick. And that the location of the files doesn't make a difference.
Yet file location does matter. I copied identical sample jekyll projects so there was one on the linux filesystem one on NTFS.
On linux jekyll serve executes but the plugin is not generating the thumbnail file version that jekyll is expecting. The build completes but with errors due to the missing thumbnail file. So the build wont complete when the files reside on NTFS, but will when the files are on linux.
At this point my theories are 1) weirdness caused by VMware Player file sharing (but one that does not affect ruby & gems consistently) or 2) something in the plugin code, which I don't have the skill to assess.
Any comments, ideas?

Full installation instruction of youtube-dl in windows

I have just downloaded the youtube-dl-2014.07.15.tar_2.gz in my windows. At first I want to tell I don't know anything about python. And I already have installed python 2.7. Can anyone give me instruction to execute these scripts?
I have already tried to run...but there is some error like these. "No mudule named youtube-dl"
I want a fresh start. Now I am using windows 8.1 and I have also tried youtube-dl.exe. And there is also problem like screenshot
If I want to get worked both script and program what will I do?Any helps will be appreciated. If you give me instruction from scratch that will be better.
To install youtube_dl in Python on Windows (command from their github):
Tested with Python 3.9 on Windows 10
pip install --upgrade youtube-dl
Now when using it, notice that the name of the Python module is with an underscore.
Because it is a Python module, use it like so:
py -m youtube_dl <video url>
Of course video url is the video you want to download
This seems to be caused by a limitation of py2exe. You may want to file a youtube-dl bug report for moving to a cxfreeze, which should not have that problem. In any case, simply moving the youtube-dl.exe file into another directory such as C:\Users\Shamim should fix the problem.
you need just to put the youtube-dl.exe file in in your home directory or any other location on your PATH.
You can see your PATH in your "Envirenment Variables"

ImageMagick can't use JPEG (OSX/X11)?

Trying to give RMagick a whirl, using Mac OSX and homebrew.
Versions:
Mac OSX 10.7.5, HomeBrew 0.9.4., Ruby 2.0, Rmagick 2.13.2, ImageMagick 6.8.6-3.
Here is my Ruby code, in a file named rename.rb:
require 'RMagick'
include Magick
cat = ImageList.new("test.jpg")
cat.display
exit
and here is my terminal output:
rename.rb:5:in `display': delegate library support not built-in `test.jpg' (X11) # error/display.c/DisplayImages/16067 (Magick::ImageMagickError)
from rename.rb:5:in `<main>'
It seems though I have the proper delegates installed (I'm not entirely sure, however, since I'm a n00b at ImageMagick). If I run convert -list configure, I get this:
...
DELEGATES bzlib fontconfig freetype jng jpeg png rsvg tiff xml zlib
...
any ideas? Thanks!
The image has been read and processed successfully, your error is being thrown by cat.display It is not an image format delegate missing, but a window display one.
You will see the same error message on the command line if you simply type:
display test.jpg
So this is an Image Magick issue, not an RMagick or Ruby one.
It seems that the display method is designed to work with X11 windowing, which is not a default feature on Mac OS X. You may be able to re-build it including an X11 service and libary. I use XQuartz for X11 support, but installing it after Image Magick (as I did) won't fix this issue. So, I get same error as you, but I don't use display, I just use a command like open test.jpg on the command line, or:
`open test.jpg`
from Ruby. This is not a platform-agnostic solution, but I can view the images I process just fine.
Alternatively, you could try re-installing Image Magick and rmagick with X11 support (provided of course that you have an X11 service installed such as XQuartz):
brew unlink imagemagick
brew install imagemagick --with-x11
gem install rmagick
I have tested this, and it works to so that cat.display will launch a display window. Although I think I will continue to use other viewers myself.

how to tell cpanm Image::Magick about header location?

On OS X cpanm Image::Magick fails with
Magick.xs:60:10: fatal error: 'magick/MagickCore.h' file not found
#include < magick/MagickCore.h>
The file is present though. (That space is from me to have it display here.)
How can I tell cpanm and/or Image::Magick where to find those headers?
(IM is installed from source.)
Workaround: download Module, edit Makefile.PL (add header dir to includes), make, make install as written on the imagemagick homepage.
While the question is rather old, I still ran into this issue recently.
I was able to resolve it with new ImageMagick installed via homebrew (brew install imagemagick which installed version 6.9.5-3), then firing up cpan and installing JCRISTY/PerlMagick-6.89-1.tar.gz package.
It fails in test section. Thus I analysed what tests fails and decided to cheat a bit (I don't need all ImageMagick functions). I manually edited tests files (use look Image::Magick to get into unarchived package) – for me, it was required to completely comment out test for input.miff (reference/filter/Segment.miff) in t/filter.t and tests for MPEG read in t/mpeg/read.t. Then cpan is able to process Image::Magick finally.
I ran my own tests upon set of GIF and PNG images and these are OK. Hope this helps someone.

I can't install Haml/Sass on Windows using RubyInstaller for Windows

I never used ruby before, I just wanted to play around with HAML and SASS. I downloaded and installed Ruby's Windows installer (v1.9.1). Then, I clicked ruby.exe (the icon with a black window and a multicolored gem in the picture). Finally, I typed gem install haml and pressed Enter. But nothing happened. Am I doing something wrong?
Reference picture:
alt text http://img707.imageshack.us/img707/9863/haml.png
You might need to put the path to Ruby into the PATH environment variable to do this, but this is how I do it:
I open up the command line utility. I then type ruby -S gem install <whatever>. This works like a charm.
I tried running Ruby and it shows a blank screen but lets me type code. When I press CTRL + C to cancel it then executes my code as well. Maybe you need to do that in the manner you are trying to right now. I just find it easier to just ruby -S <statement> instead. IronRuby gives me the REPL no problems though.
ruby.exe is the Ruby interpreter. If you want to type code into it, you obviously need to type Ruby code into it, not DOS command code.
The gem command is a DOS batch file (gem.bat). DOS batch files need to be run from the DOS command interpreter.
Installing Ruby using RubyInstaller, you get an shortcut in the Programs menu that let you open a command prompt with Ruby in the PATH
You use that in case you didn't select the option to add Ruby to the PATH.
Either case, the gem command you typed in should be entered at the command prompt, and not inside Ruby itself.
The latest build (rubyinstaller-1.9.2-p136.exe) had a problem. Rename the folder: c:\ruby192\lib\ruby\site_ruby or delete it altogether and this fixes "gem"
You can do "gem install compass" or if you're behind a proxy you might need to do.
gem install –http-proxy compass
Here's a blog post with all the details:
http://francisshanahan.com/index.php/2011/how-to-theme-sencha-touch-sass-windows/
Hope that helps,
-fs
this is how i installed ruby and sass on my windows machine: How to install ruby and sass on windows?

Resources