I am installing rmagick in mac system, I have installed imagemagick version 7 by using the command brew install imagemagick , now I am executing gem install rmagick but I am getting the below error.
Can't install RMagick 2.16.0. Can't find MagickWand.h.
I have added export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH" in my bashfile but no luck
Finally , I downgraded the version of imagemagick to make it working i.e.
brew uninstall imagemagick
brew uninstal imagemagick#6
Then, set the path for MagicWand & MagicCore.h
export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick\#6/6.9.7-6/lib/pkgconfig/
Try uninstalling ImageMagick and re-installing with the --build-from-source option and that will get you the header you seek:
brew rm imagemagick
brew install imagemagick --build-from-source <ANY OTHER OPTIONS>
Now check you have it:
find /usr -name "MagickWand.h"
/usr/local/Cellar/imagemagick/7.0.4-6/include/ImageMagick-7/MagickWand/MagickWand.h
Related
Please help, I tried to install Miniconda on Mac OS X Mojave with:
brew cask install miniconda
then I added export path to .zshrc file (Oh my Zsh):
export PATH="$PATH:$HOME/miniconda3/bin"
But it is not being recognized:
zsh: command not found: conda
I cant find what I am doing wrong
I finally had to do a workaround by downloading it directly:
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh
but I still don't understand why Homebrew is not working
After brew cask install miniconda, it was installed to /opt/miniconda3
After installing miniconda using homebrew, you will need to run:
/opt/miniconda3/condabin/conda init zsh
For more info see https://discourse.brew.sh/t/why-does-brew-cask-install-miniconda-to-opt-instead-of-usr-local-caskroom/7926
Unfortunately on my MAC I am unable to get the gem "rmagick" to install. I've tried pretty much a all the options.
I had gotten it to install when I used "imagemagick 6.3.9.7".
Therefore, I want to know is there a way to install a particular version of the software using brew ?
Something like
brew install imagemagick -v 6.3.9.7
Search for available versions with:
brew search imagemagick
To install a specific version use this forumla: brew install package#<version>, in your case it's:
brew install imagemagick#6.3.9.7
I'm trying to install wxWidgets on Mac OS X 10.9. It's already installed, but I'm having the problem described here. Someone suggested to add ENV.append_to_cflags "-stdlib=libc++". I did, but I'm not able to recompile the code.
$ brew install wxmac
Warning: wxmac-3.0.0 already installed
$ brew edit wxmac
=> ok, modifications done, now I want to recompile and reinstall
$ brew uninstall wxmac
Uninstalling /usr/local/Cellar/wxmac/3.0.0...
$ brew install wxmac
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/wxmac- 3.0.0.mavericks.bottle.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/wxmac-3.0.0.mavericks.bottle.2.tar.gz
==> Pouring wxmac-3.0.0.mavericks.bottle.2.tar.gz
🍺 /usr/local/Cellar/wxmac/3.0.0: 775 files, 41M
How can I force homebrew to recompile?
Homebrew is installing wxmac in bottle form (a pre-compiled binary of wxmac). To build from source, add the --build-from-source flag when calling brew install:
$ brew install --build-from-source wxmac
To rebuild all installed FORMULAE from source:
$ brew list | xargs brew reinstall --build-from-source
I am trying to run one project on my local machine. I installed Ruby and Rails on my Mac OS system. It is working properly. I can create a new project and can run it properly without any error, but when I try to run the existing project it says that we have to bundle install. When I run that command I get the following error:
"An error occurred while installing rmagick (2.13.2), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling."
When I run gem install rmagick -v '2.13.2' it gives me the following error:
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc-4.2... yes
checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in /usr/local/rvm/gems/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392#global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392#global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p392/bin:/usr/local/rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rmagick-2.13.2 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rmagick-2.13.2/ext/RMagick/gem_make.out
I have searched and did not find an answer anywhere.
For Ubuntu, I used the ff. based on this link:
$ sudo apt-get install libmagick++-dev
On a mac (the below code works on OSX Mavericks):
brew install imagemagick
gem install rmagick
On Mac you can try this:
$ brew unlink imagemagick
$ brew install imagemagick#6 && brew link imagemagick#6 --force
$ gem install rmagick
I have solved this problem by installing imagemagic:
sudo apt-get install imagemagick
and then install libmagick package:
sudo apt-get install libmagick++-dev
For Linux Fedora, I got same error and fixed with below two commands:
yum install ImageMagick
gem install rmagick
For Centos install ImageMagick-devel package. using below commands:
yum install ImageMagick-devel
gem install rmagick
First, make sure you've installed Imagemagick :
$ sudo apt-get install imagemagick
Now, it can build the gem native extension.
Then, install the Rmagick gem :
$ sudo gem install rmagick
here's what i did on 16.04,
sudo apt-get install libmagickwand-dev
sudo apt-get install graphicsmagick-imagemagick-compat
and then install gem like that
PATH="/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16:$PATH" gem install rmagick -v '2.13.2'
May be you are installing ImageMagick version 7.x.x which will generate different folder names in your usr/lib/local/include/ImageMagick7.x.x folder.
E.g.
In ImageMagick6.x.x version we have magick, wand named folders, where in ImageMagick7.x.x version have named this MagickCore , MagickWand . So this updation is causing the problem in some gem installation like here. Which is using
magick/some_header.h or wand/some_header.h (Means they are not updated with the new 7.x.x ImageMagick version).That's why we are getting this error :
```
checking for outdated ImageMagick version (<= 6.4.9)... no
checking for presence of MagickWand API (ImageMagick version >= 6.9.0)... no
....
checking for wand/MagickWand.h... no
```
and in log file something like this :
error: 'MagickCore/method-attribute.h' file not found
#include "MagickCore/method-attribute.h"
^
Solution
Install the ImageMagick6.x.x version in your system from the official site : https://www.imagemagick.org/download/ and install it using this commands(after extract zip/tar) :
./configure
make
make install
Then do
gem install rmagick
It will work.
As per the error log it looks like "Magick-config" is missing.
You need to install ImageMagik or GraphicsMagick. These are the commands you should follow which is taken from RMagik Documentation:
1) Go to http://www.imagemagick.org or http://www.graphicsmagick.org and download the latest version of the software to a temporary directory. the extract them :
- tar xvzf ImageMagick.tar.gz
- cd ImageMagick-x.x.x
- ./configure --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8
- make
- sudo make install
- sudo gem install rmagick
Solution for Ubuntu:
sudo apt-get install imagemagick
ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
first run this:
sudo apt-get install imagemagick
then: sudo apt-get install libmagick++-dev
now install rmagick: gem install rmagick
Just run these command
• $ sudo apt-get install imagemagick
• $ sudo apt-get install libmagick++-dev
• $ sudo gem install rmagick
• $ bundle install
I had this same issue when setting up a Rails 6 application in Ubuntu 20.04.
Here's how I solved it
RMagick is an interface between the Ruby programming language and the ImageMagick image processing library. So we first need to install development libraries for ImageMagick:
Step 1:
On Ubuntu, you can run:
sudo apt-get install libmagickwand-dev
On Centos, you can run:
sudo yum install gcc ImageMagick-devel make which
On Arch Linux, you can run:
pacman -Syy pkg-config imagemagick
On Alpine Linux, you can run:
apk add pkgconfig imagemagick imagemagick-dev imagemagick-libs
or you can run if you would like to use ImageMagick 6:
apk add pkgconfig imagemagick6 imagemagick6-dev imagemagick6-libs
On macOS, you can run:
brew install pkg-config imagemagick
or you can run if you would like to use ImageMagick 6:
brew install pkg-config imagemagick#6
On Windows:
Install the latest Ruby+Devkit package which you can get from RubyInstaller for Windows.
You might need to configure PATH environment variable to where the compiler is located.
(Ex: set PATH=C:\Ruby27-x64\msys64\usr\bin;C:\Ruby27-x64\msys64\mingw64\bin;%PATH%)
Download ImageMagick-7.XXXX-Q16-x64-dll.exe (not, ImageMagick-7.XXXX-Q16-x64-static.exe) binary from Windows Binary Release, or you can download ImageMagick 6 from Windows Binary Release.
Install ImageMagick. You need to turn on checkboxes Add application directory to your system path and Install development headers and librarries for C and C++ in an installer for RMagick.
Step 2:
Install the RMagick ruby gem:
gem install rmagick
Step 3:
Now you can add the RMagick ruby gem to your Gemfile:
gem 'rmagick', '~> 4.1'
Note: As of this writing the latest version is 4.1
Step 4:
Finally, you can run bundle install to install the gem to your application.
Resources: rmagick/rmagick GitHub page
That's all.
I hope this helps
Just install ImageMagick-devel package and everything should be fine :)
For Ubuntu Server, I installed it by doing this:
sudo apt-get install imagemagick
sudo apt-get install libmagick++-dev
sudo gem install rmagick -v '2.15.4'
All here wrong for me :(
this helped:
sudo apt-get install libmagickwand-dev
according to rmagick github page
then bundle install went with no errors
If you are using openSUSE, then first check if the ImageMagick installed or not. If it is installed, then do install it development header file.
[arup#sztukajedzenia]$ sudo zypper se imagemagic
root\'s password:
Loading repository data...
Reading installed packages...
S | Name | Summary | Type
--+-------------------+-------------------------------------------------------+-----------
i | ImageMagick | Viewer and Converter for Images | package
| ImageMagick | Viewer and Converter for Images | srcpackage
| ImageMagick-devel | Include Files and Libraries Mandatory for Development | package
| ImageMagick-doc | Document Files for ImageMagick Library | package
| ImageMagick-extra | Viewer and Converter for Images - extra codecs | package
[arup#sztukajedzenia]$ sudo zypper in ImageMagick-devel
root\'s password:
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following 2 NEW packages are going to be installed:
ImageMagick-devel libbz2-devel
........
You need to run both the command for ubuntu
sudo apt-get install libmagick++-dev
sudo apt-get install imagemagick
Then try to install
gem install rmagick
For mac users, install imagemagick 6 since the newest version 7 isn't compatible.
brew install imagemagick#6
gem install rmagick
The above should work after you uninstall what you already have.
For Fedora 27 I resolved this problem:
sudo dnf install ImageMagick-devel ImageMagick
gem install rmagick
I used a script to install ImageMagick http://github.com/masterkain/ImageMagick-sl
After a while, I got ImageMagick installed.
Then I ran sudo gem install rmagick and got
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in...
I'm working in OSX Snow Leopard with Ruby 1.9.2 and Rails 3. Any ideas?
I was getting the same error and it got resolved after installing the libmagick9-dev library on ubuntu 11.
Update (Thanks to the commenters - Dec. 2012)
$ sudo apt-get install libmagickwand-dev or $ sudo apt-get install graphicsmagick-libmagick-dev-compat for ubuntu 12
$ sudo apt-get install libmagickwand-dev or $ sudo apt-get install libmagick9-dev for ubuntu 11 or below.
$ yum install ImageMagick-devel for centos
$ brew install imagemagick for Mac OS (using Homebrew)
you need the imagemagick libraries under ubuntu
$ sudo apt-get install libmagickwand-dev
it contains all missing libraires
then run bundle install command
I believe you need the Imagemagick libraries.
If you are using Homebrew (which I'd highly recommend), simply do
$ brew install imagemagick
Then rerun bundle install
Mac OS Mountain Loin (using Homebrew)
download and install http://xquartz.macosforge.org/trac/wiki/X112.7.2
brew install imagemagick
gem install rmagick
sudo apt-get install libmagickwand-dev
works well for Ubuntu 12.10
This is assuming you have installed all other dependencies viz.
sudo apt-get install imagemagick ruby ruby-dev gem`
On CentOS 5.7, I got it to work by first specifying PKG_CONFIG_PATH:
export PKG_CONFIG_PATH=/usr/local/src/ImageMagick-6.7.5-10/magick/
gem install rmagick
For those who got
InitializeMagick() in -lMagickCore... no; -lMagick... no; -lMagick++... no;
this worked for me in OS X 10.8: https://github.com/maddox/magick-installer
From here: RVM + Ruby 1.9.2 + Rmagick + Lion = System Works, RVM Doesn't
Initially, I came around to installing rmagick because it seemed to be a dependency when I tried installing libgtk2.0-dev. I was trying to install that package, because the RGtk2.0 is a requirement for using R package called rattle.
Anyway, none of the above solutions worked for me in installing in my Ubuntu 12.04. Even running sudo apt-get update first didn't seem to help, nor this related posting: Installing rmagick on Ubuntu
I eventually found what works is to troubleshoot using sudo aptitude rather than apt-get.
https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages
I recommend the technique of using aptitude to work through the package installation issue.
On Mac Os X, check if /opt/local/bin is in your PATH. If not:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
sudo gem install rmagick
This worked for me!
I had an issue installing Rmagick gem version 2.13.2 on Debian Jessie. After fighting with the packages in the other answers, I upgraded the version of the Rmagick gem from 2.13.2 to the latest (2.16.0 at time of writing). This installed successfully.
bundle update rmagick
If you tried all solutions, of all posts of whole Internet, have installed and reinstalled many times all indicated packages in all Linux or Mac distributions/versions (even in Windows) and it still not working, close your terminal and open it again. Some times, even if your reload all shell environment, only after I reopen the terminal the bundle install was successfully completed.
After several days of searching, my problema was related to some missing libraries, and the one that get the gem installed was this one:
brew install pkg-config
after this I did my bundle install again and it worked.