Error in rmagick installation in ruby and rails - ruby-on-rails

Hiall,
I am new to ROR . I am trying to install rmagick on my local machine . When I try to install it everytime i get the following error :
Please help me out with this situation .
D:\ruby\bin>gem install rmagick --platform=ruby -- --with-opt-lib=D:\ruby\Rmmagik\lib --with-opt-include=D:\ruby\Rmmagik\include Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
D:/ruby/bin/ruby.exe extconf.rb --with-opt-lib=D:\ruby\Rmmagik\lib --with-opt-include=D:\ruby\Rmmagik\include
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no
Can't install RMagick 2.13.1. Can't find MagickWand.h.
*** 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=${opt-dir}/include
--with-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=D:/ruby/bin/ruby
Gem files will remain installed in D:/ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to D:/ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
Thanks in advance
Surjan

You're missing a header file.
It looks like you're on Windows, right?
If so, a simple solution may be to download the pre-built ImageMagick binary for Windows.
Link
If you're on Debian or Ubuntu:
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
(Editors, feel free to add solutions for other platforms)

Related

ERROR: Error installing rmagick on Redhat 7

I am trying to run my Rails application in Redhat7 but facing this error when I run bundle install:
An error occurred while installing rmagick (2.13.4), and Bundler
cannot continue. Make sure that gem install rmagick -v '2.13.4'
succeeds before bundling.
When I run gem install rmagick, this is the error I am getting:
[root#ip-172-12-13-148 MyProject]# gem install rmagick -v '2.13.4'
Building native extensions. This could take a while... ERROR: Error
installing rmagick: ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/rmagick-2.13.4/ext/RMagick
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r
./siteconf20160818-2119-1nvxrgu.rb extconf.rb checking for Ruby
version >= 1.8.5... yes checking for gcc... yes checking for
Magick-config... no checking for pkg-config... yes checking for
ImageMagick version >= 6.4.9... yes Package MagickCore was not found
in the pkg-config search path. Perhaps you should add the directory
containing MagickCore.pc' to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found Package MagickCore was not found in the
pkg-config search path. Perhaps you should add the directory
containingMagickCore.pc' to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found Package MagickCore was not found in the
pkg-config search path. Perhaps you should add the directory
containing MagickCore.pc' to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found Package MagickCore was not found in the
pkg-config search path. Perhaps you should add the directory
containingMagickCore.pc' to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found checking for stdint.h... yes checking
for sys/types.h... yes checking for wand/MagickWand.h... no
Can't install RMagick 2.13.4. Can't find MagickWand.h.
* 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-2.3.0/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.13.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/usr/local/rvm/gems/ruby-2.3.0/gems/rmagick-2.13.4 for inspection.
Results logged to
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.13.4/gem_make.out
I tried using
yum install IMageMagickand run bundle, but issue continues.
[root#ip-172-12-13-148 MyProject]# yum install ImageMagick-devel
then:
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
No package ImageMagick-devel available.
Error: Nothing to do Please help.
Please help.
For RedHat try running this command
yum install ImageMagick ImageMagick-devel
Refer - this

Error while installing ImageMagick for Ruby on Rails on Windows

I'm installing ruby on rails and redmine with xampp following this documentation:
http://nlb-creations.com/2013/06/26/installing-ruby-on-rails-and-redmine-with-xampp-on-windows-7/
Step 12 requires installing rmagick, I followed the steps correctly till I reached 12-d :
In the cmd window, run the following:
gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagick/lib --with-opt-include=c:/ImageMagick/include
I got the following error:
C:\xampp\htdocs\dev-ruby\redmine>gem install rmagick --platform=ruby -- --with-o
pt-lib=c:/ImageMagick/lib --with-opt-include=c:/ImageMagick/include
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb --with-opt-lib=c:/Im
ageMagick/lib --with-opt-include=c:/ImageMagick/include
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** 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=${opt-dir}/include
--with-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/RailsInstaller/Ruby1.9.3/bin/ruby
Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9
.1/gems/rmagick-2.13.3 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rmagick-2
.13.3/ext/RMagick/gem_make.out
I downloaded ImageMagick-devel-6.8.9.9.aarch64.rpm cz it might solve my problem but I don't know how to install it. Any ideas please?
Sounds like you're trying to install the RMagick gem before installing ImageMagick:
The RPM is for certain Linux distributions.
Try installing http://www.imagemagick.org/script/binary-releases.php#windows then the gem.

Rmagick and carrierwave installment in dreamhost vps

I am trying to install carrierwave not on my machine but on a vps hosted on dreamhost.
Here the Gemfile
gem "rmagick"
gem 'carrierwave'
Here the error when bundling:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/wywvps/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
checking for gcc... yes
checking for Magick-config... yes
Warning: Found more than one ImageMagick installation. This could cause problems at runtime.
/usr/bin/Magick-config reports version 6.6.0 Q16 is installed in /usr
/usr/bin/X11/Magick-config reports version 6.6.0 Q16 is installed in /usr
Using 6.6.0 Q16 from /usr.
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no
Can't install RMagick 2.13.1. Can't find MagickWand.h.
*** 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
--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=/home/wywvps/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
Gem files will remain installed in /home/wywvps/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1 for inspection.
Results logged to /home/wywvps/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
An error occurred while installing rmagick (2.13.1), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.1'` succeeds before bundling.
try installing
sudo apt-get install libmagickwand-dev imagemagick
It says that you do not have "MagickWand.h" file in the wand folder.
Please check that in your installation folder of your ImageMagick is this file located.
Petr

Can't install RMagick 2.13.1. Can't find Magick-config

$ gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/XXXXXXX/.rvm/rubies/ruby-1.9.2-p180/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 /Users/XXXXXXX/.rvm/gems/ruby-1.9.2-p180/bin:/Users/XXXXXXX/.rvm/gems/ruby-1.9.2-p180#global/bin:/Users/XXXXXXX/.rvm/rubies/ruby-1.9.2-p180/bin:/Users/XXXXXXX/.rvm/bin:/Users/XXXXXXX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin
*** 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=/Users/XXXXXXX/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
Gem files will remain installed in /Users/XXXXXXX/.rvm/gems/ruby-1.9.2-p180/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/XXXXXXX/.rvm/gems/ruby-1.9.2-p180/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
But when I do this:
$ locate Magick-config
/opt/local/bin/Magick-config
/opt/local/share/man/man1/Magick-config.1.gz
/opt/local/var/macports/software/ImageMagick/6.6.4-9_0+q16/opt/local/bin/Magick-config
/opt/local/var/macports/software/ImageMagick/6.6.4-9_0+q16/opt/local/share/man/man1/Magick-config.1.gz
/opt/local/var/macports/software/ImageMagick/6.6.5-0_0+q16/opt/local/bin/Magick-config
/opt/local/var/macports/software/ImageMagick/6.6.5-0_0+q16/opt/local/share/man/man1/Magick-config.1.gz
Any ideas?
command: sudo apt-get install libmagickwand-dev
It isn't quite the answer to the question, but the recommended way of installing Imagemagick and Rmagick on Mac is through homebrew. It's the only way I could get Imagemagick and Rmagick playing nicely together on Mac.
For Ubuntu (11.10+) try installing the libmagick++-dev package.
For other Linux distributions, try installing the libmagick-dev package.
For my case, I am installing it on Ubuntu/Linaro 4.5.2-8ubuntu3, got same error, tried to installed the following two package suites and it worked, maybe either one of them:
sudo apt-get install graphicsmagick-libmagick-dev-compat
sudo apt-get install libmagickwand-dev
On mac, after
brew install imagemagick
Don't forget to link dylibs with:
brew link imagemagick
I had to transfer an old application to a debian stretch server.
The used ruby version was 2.0.x.
imagemagick was installed including libmagickwand-dev.
Trying to install rmagick 2.13.2 failed.
I had to upgrade the rmagick verion (patched my Gemfile.lock) to use rmagick 2.16.0, the last version supporting ruby 2.0.

How to install mysql gem on Mac os 10.6?

i just installed MAMP on this iMac and the rubygems but when i run:
sudo gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
gives me
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
ERROR: could not find gem — locally or in a repository
ERROR: could not find gem –with-mysql-config=/usr/local/mysql/bin/mysql_config locally or in a repository
how can i install this gem ?
I found this and worked out perfectly:
you can go to http://www.tmtm.org/en/ruby/mysql/ to download the tar
file, and run the command below
# ruby ./install.rb
to install the mysql.rb
Use the following it worked with me
brew install mysql
Do you have the Xcode developer tools installed on Mac OS X? If not, I'd start there.
You can download them here: http://developer.apple.com/technologies/xcode.html
Once you've installed that, try again.
i'm still getting this
$ sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
* 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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
--with-mysql-config
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
You need the mysql development libs to compile it. If you were on linux you could use "yum install mysql-devel". Not sure about how to get them installed on a mac, but try downloading the connector libraries from here:
MySql Connector Downloads
You may have to pass in a --with-mysql-libs option to point to the directory when the C libraries are unpacked to. Hope this points you in the right direction.
Or you can just put the libraries in the default directory:
/usr/lib64/mysql
Download mysql-dev from mysql.com

Resources