This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
ImageMagick / RMagick - Can't install RMagick 2.13.1. Can't find Magick-config
I am getting the following error when I try to run my dev console (MAC OS X / Snow Leopard). Does anyone know the solution?
/usr/local/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 .:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/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.
I solved it by Installing libmagickwand-dev
apt-get install libmagickwand-dev
gem install rmagick
Before, I was getting following error (even after installing libmagick9-dev):
apt-get install libmagick9-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libmagick9-dev is a virtual package provided by:
libmagickwand-dev 7:6.4.5.4.dfsg1-1ubuntu3.1
You should explicitly select one to install.
E: Package libmagick9-dev has no installation candidate
It seems that this problem is common in time to install the RMagick gem ... I had the same problem, and I've found the solution in this same site. Follow the link here.
Solution:
sudo apt-get install libmagick9-dev
I had a similar problem because I didn't include a library for a specific gem. Check your gems and see if they depend on a library which image gems always do.
config.gem gem_name, :lib => 'path_of_your_library'
Related
I am using cloud9.
I want to use gem 'rmagick', but using bundle, following error message occurs...
please help...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/usr/local/rvm/gems/ruby-2.4.0/gems/rmagick-2.16.0/ext/RMagick
/usr/local/rvm/rubies/ruby-2.4.0/bin/ruby -r
./siteconf20180204-XXXXXX-oyXXpq.rb extconf.rb checking for gcc... yes
checking for Magick-config... no checking for pkg-config... 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
checking for outdated ImageMagick version (<= 6.4.9)... * 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.
I just spun up a Cloud9 VM and tried it.
My Cloud9 VM I tried used yum as a package manager. Meaning I installed ImageMagick via sudo yum install ImageMagick-devel... when I did that my gem install rmagick worked.
Didn't try it with Bundler, but if gem install works then it should work in Bundler also.
Using the command prompt install/update imagemagick via
sudo apt-get update
Then
sudo apt-get install imagemagick
See more
Hope it helps
This question already has answers here:
Rails: Installing PG gem on OS X - failure to build native extension
(15 answers)
Closed 7 years ago.
when running bundle install (or gem install pg) i get the following error i have already tried fixing the xcode command line tools
/Users/josh/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.
Ruby 2.0.0
Rails 4.0.2
OSX 10.9.1
I just had this same problem today and this answer solved it for me.
https://stackoverflow.com/a/19620569/91970
Hope that helps.
Summary
brew update
brew install postgresql
bundle install
For reference, the code #marcamillion is linking to:
brew update
brew install postgresql
bundle install
I had the same problem .. I've modified Gemfile.lock and replaced pg (0.17.1) with pg(0.18.1) only.
Download PostgreSQL 9.4 and installed in system
use following command to install pg now
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config
I'm trying to set up cucumber for rails. I included this in my Gemfile and ran bundle install.
gem 'cucumber-rails'
gem 'database_cleaner'
I got this error. What should I do?
ERROR: Error installing gherkin:
ERROR: Failed to build gem native extension.
/Users/[my_user_name]/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for main() in -lc... *** 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.
This question is a bit old, but as I just had a similar problem on my machine I will document my solution here.
The problem seems to be related to OS X Lion, GCC, clang etc. (see https://github.com/carlhuda/bundler/issues/1590 and https://github.com/carlhuda/bundler/issues/1600). As how ruby was compiled seems to be the problem I decided to re-install (and also upgrade) ruby.
Here is what solved this issue for me:
I use the Command Line Tools for Xcode package.
Furthermore the current version of rbenv and ruby-build (both installed via homebrew)
rbenv install 1.9.3-p125 failed (see https://github.com/sstephenson/ruby-build/issues/129 and https://github.com/sstephenson/ruby-build/issues/130)
remove the require_gcc line for 1.9.3-p125 (if installed with homebrew you find the file under /usr/local/Cellar/ruby-build/20120216/share/ruby-build/1.9.3-p125)
finally successfully install 1.9.3-p125 with env CC=/usr/bin/gcc rbenv install 1.9.3-p125
Complicated but I can now install gems with natiive extensions.
Hope this helps.
Update: btw. It is possible to keep using ruby-1.9.2-p290, all you have to do is re-install it.
First "uninstall" the old ruby-1.9.2-p290: rm -rf .rbenv/versions/1.9.2-p290
Next remove the require_gcc line for 1.9.2-p290
Finally install with env CC=/usr/bin/gcc rbenv install 1.9.2-p290
all! I have a problem when installing rmagick gem on CentOS 5.5 server. When I issued command:
gem install rmagick
I got:
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 /usr/bin:/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.
I have installed imagemagick with correct version, and I find Magick-config in /usr/local/bin and my PATH includes that dir. However, the rmagick gem installer just does not search that dir for Magick-config. What should I do?
By the way, I have another CentOS 5 machine installing ruby and rmagick successfully, and the latter has the Magick-config file in /usr/local/bin, too.
did you installed Imagemagick? eg:
yum install gcc gcc-c++ ImageMagick-devel ghostscript freetype-devel \
libjpeg-devel libpng-devel libpng10-devel libwmf-devel libexif-devel \
libtiff-devel
See this brilliant post on how to fix it. Just skip the last 3 lines as they are PHP related.
http://codercake.com/installing-imagemagick-6-6-9-7-and-imagick-for-php-on-centos-5-5-64-bit/#comment-39
here the commend which I was used in my command prompt. Please check the version
gem install rmagick -v '2.13.1' --platform=ruby -- --with-opt-lib=C:/ImageMagick-6.8.7-Q8/lib --with-opt-include=C:/ImageMagick-6.8.7-Q8/include
On Mac High Sierra - 10.13.4 - https://www.imagemagick.org/script/download.php
sudo port install ImageMagick
sudo gem install rmagick
While trying to run a first project on Ubuntu 10.10 I got this:
antonio#antonio-desktop:~/Documents/tickets$./script/rails server
Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
Well, afterwards I write:
antonio#antonio-desktop:~/Documents/tickets$ bundle install
and get this in the middle of the installation process:
/usr/bin/ruby1.8 extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite3-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** 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.
So, I tried this:
sudo yum install sqlite3-devel
And got this:
Setting up Install Process
No package sqlite3-devel available.
Nothing to do
Why? I'm running Rails 3.1, btw.
try: sudo apt-get install libsqlite3-dev
Since you're using yum, I went ahead and guessed that you're on Fedora. I then Googled "fedora sqlite3" and found a blog post that recommends this:
sudo yum install sqlite-devel
Sounds like the gem doesn't have the package name quite right. Give this one a go :)