ruby on rails rmagick can't use, cloud9 - ruby-on-rails

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

Related

PostgreSQL gem failing in bundle install for Rails on CentOS 6

I've been all over trying all sorts of solutions so I'd appreciate any help.
I have the following PostgreSQL items installed:
postgresql96.x86_64 - 9.6.12-1PGDG.rhel6
postgresql96-devel.x86_64 - 9.6.12-1PGDG.rhel6
postgresql96-libs.x86_64 - 9.6.12-1PGDG.rhel6
postgresql96-server.x86_64 - 9.6.12-1PGDG.rhel6
When I run bundle install, I get the following error:
Installing pg 1.1.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/home/admin/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/pg-1.1.4/ext
/home/admin/.rbenv/versions/2.6.1/bin/ruby -I
/home/admin/.rbenv/versions/2.6.1/lib/ruby/2.6.0 -r ./siteconf20190502-8579-10nqtt0.rb extconf.rb
--with-pg-config\=/opt/local/lib/postgresql91/bin/pg_config
Using config values from /opt/local/lib/postgresql91/bin/pg_config
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
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.
A large majority of the guides say that we need to install the devel and libs packages but they are already installed. I am using CentOS 6.
Thanks!
Also I should add that I'm using yum as my package manager, thanks.
I am pretty sure you need the postgres client tools also... when compiling postgres on the server. You should install the devel packages for postgres server and the command line tools.
Looks like for CentOS libpq-fe.h header comes with postgresql-devel:
yum install postgresql-devel
Ref https://stackoverflow.com/a/6040822/4950680

Gem installation ruby-audio-1.6.1 error(using Mac OS 10.9 / homebrew)

I tried other tips but didn't work. (see link below please)
ex.
Gem installation ruby-audio failing
ruby-audio 1.6.1 install error (with installed Libsndfile 1.0.25)
I want some feedback on this.
$ gem install ruby-audio<br>
Building native extensions. This could take a while...<br>
ERROR: Error installing ruby-audio:<br>
ERROR: Failed to build gem native extension.<br>
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
<br>
**checking for sndfile.h in /opt/local/include,/usr/local/include,C:/Program Files (x86)/Mega-Nerd/libsndfile/include,C:/Program Files/Mega-Nerd/libsndfile/include... yes<br>
checking for sf_open() in -lsndfile-1... no<br>
checking for sf_open() in -lsndfile... no<br>**<br>
*** extconf.rb failed ***<br>
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.<br>
<br>
Provided configuration options:<br>
--with-opt-dir<br>
--without-opt-dir<br>
--with-opt-include<br>
--without-opt-include=${opt-dir}/include<br>
--with-opt-lib<br>
--without-opt-lib=${opt-dir}/lib<br>
--with-make-prog<br>
--without-make-prog<br>
--srcdir=.<br>
--curdir<br>
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby<br>
--with-sndfile-dir<br>
--without-sndfile-dir<br>
--with-sndfile-include<br>
--without-sndfile-include=${sndfile-dir}/include<br>
--with-sndfile-lib<br>
--without-sndfile-lib=${sndfile-dir}/<br>
--with-sndfile-1lib<br>
--without-sndfile-1lib<br>
--with-sndfilelib<br>
--without-sndfilelib<br><br>
**extconf.rb:21:in `<main>': Can't find libsndfile (http://www.mega-nerd.com/libsndfile/) (RuntimeError)**<br>
<br>
Try passing --with-sndfile-dir or --with-sndfile-lib and --with-sndfile-include<br>
options to extconf. If there are spaces in the path on windows, it may not work.<br>
<br>
<br>
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ruby-audio-1.6.1 for inspection.<br>
Results logged to /Library/Ruby/Gems/2.0.0/gems/ruby-audio-1.6.1/ext/rubyaudio_ext/gem_make.out
You probably need to install libsndfile as a universal library - by default it doesn't compile a 32-bit slice, which is required for compatibility with the system ruby.
brew uninstall libsndfile
brew install libsndfile --universal
sudo gem install ruby-audio
For ubuntu (Ubuntu 18.04)
sudo apt-get update -y
sudo apt-get install -y libsndfile-dev

Error installing TinyTDS on OSX 10.6 via gem install tiny_tds

I have been trying to install the TinyTDS gem on a Macbook with OSX 10.6. I was successful in installing Free TDS -- confirmed that it works via:
tsql -H SERVER -p 1433 -U username.
The error I'm getting from gem install tiny_tds is:
Building native extensions. This could take a while...
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.
/Users/jason/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for sybfront.h... yes
checking for sybdb.h... yes
checking for tdsdbopen() in -lsybdb... no
-----
freetds is missing.
-----
*** 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've tried specifying the TDS lib and include dirs (/usr/local/lib and /usr/local/include) without luck. I've tried reinstalling FreeTDS from source manually as well as via homebrew, but that made no difference.
I've seen a few similar issues posted, but they seem to reference an issue with locating iconv libraries which I appear to be moving beyond.
Any suggestions or references I may have overlooked? Thanks in advance.
Same problem on Ubuntu 14.04 resolved with:
sudo apt-get install freetds-dev
gem install tiny_tds
Log output:
Building native extensions. This could take a while...
/home/david/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:73: warning: Insecure world writable dir /mnt/datapart/david in PATH, mode 040777
Successfully installed tiny_tds-0.6.1
Parsing documentation for tiny_tds-0.6.1
Installing ri documentation for tiny_tds-0.6.1
Done installing documentation for tiny_tds after 0 seconds
1 gem installed
You need to install freetds with homebrew
brew update # always a good idea to update homebrew before installing anything!
brew install freetds
In my case, it seems the symlinks were not configured correctly, and using "brew link freetds" threw errors which required opening up some permissions. I tried just about everything else, and this is finally what worked:
devMac:0.95.18 Me$ sudo chown -R $USER /usr/local/share/doc/freetds/images
devMac:0.95.18 Me$ sudo chown -R $USER /usr/local/share/doc/freetds/reference
devMac:0.95.18 Me$ sudo chown -R $USER /usr/local/share/doc/freetds/userguide
devMac:0.95.18 Me$ sudo chown -R $USER /usr/local/share/man/man5
devMac:0.95.18 Me$ brew link --overwrite freetds
Linking /usr/local/Cellar/freetds/0.95.18... 2812 symlinks created
devMac:0.95.18 Me$ sudo gem install tiny_tds
Building native extensions. This could take a while...
Successfully installed tiny_tds-0.6.2
Parsing documentation for tiny_tds-0.6.2
Installing ri documentation for tiny_tds-0.6.2
Done installing documentation for tiny_tds after 0 seconds
1 gem installed
Disclaimer: I am in the early stages of learning this framework and do not have an understanding of the repercussions of using overwrite or changing these permissions.
In my case, installing Ruby 2.3.0 using brew install ruby worked. I got the idea from this question Cannot install tiny_tds on os.x 10.9.4.

RMagick install error

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

Can't find Magick-config [duplicate]

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'

Resources