rails cannot install nokogiri w Mavericks & rbenv - ruby-on-rails

running OSX 10.9.4 and XCode 5.1.1, I switched recently from rvm to Rbenv, so I need to reinstall some gems, not a big deal, but...
I am stuck w Nokogiri gem installation, even after downloading and installing october version of the XCode command line tool and running :
sudo xcode-select -s /Library/Developer/CommandLineTools/
I also installed libxml2 libxslt w brew
I am still getting an error, is there any way to solve this issue ?
yves$ gem install nokogiri
Building native extensions. This could take a while...
Building nokogiri using packaged libraries.
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/yves/.rbenv/versions/2.1.2/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
checking for iconv.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=/Users/yves/.rbenv/versions/2.1.2/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
/Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:1067:in `block in have_header'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:1066:in `have_header'
from extconf.rb:103:in `have_iconv?'
from extconf.rb:148:in `block (2 levels) in iconv_prefix'
from extconf.rb:90:in `preserving_globals'
from extconf.rb:143:in `block in iconv_prefix'
from extconf.rb:120:in `each_iconv_idir'
from extconf.rb:137:in `iconv_prefix'
from extconf.rb:427:in `block in <main>'
from extconf.rb:161:in `block in process_recipe'
from extconf.rb:154:in `tap'
from extconf.rb:154:in `process_recipe'
from extconf.rb:422:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/yves/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.3 for inspection.
Results logged to /Users/yves/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.3/gem_make.out
when installing libxml2 libxslt I got a warning , it may interfere with the nokogiri installation ?
yves$ brew install libxml2 libxslt
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libxml2-2.9
######################################################################## 100.0%
==> Pouring libxml2-2.9.1.mavericks.bottle.1.tar.gz
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/libxml2/lib
CPPFLAGS: -I/usr/local/opt/libxml2/include
what should i do next ? thanks for your advices

I got the same error a few weeks ago. This is how I solved it:
You'll have to install the broken libraries manually. Use Homebrew, which is a package manager for OS X. Make sure you update first brew update, then install the libraries:
brew install libxml2 libxslt
brew link libxml2 libxslt
You may have to install libiconv from source:
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
tar xvfz libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
make
sudo make install
And then you should be able to install the gem.
Quoted from documentation here:
http://nokogiri.org/tutorials/installing_nokogiri.html#homebrew_09
You may also need to run rbenv rehash after installing the libraries.

I have found the solution on one of the forums:
https://github.com/sparklemotion/nokogiri/issues/1111
After almost a week of searching this finally did the trick:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install nokogiri -- --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
GL

I got the same issue few days ago and this thread helped me
https://github.com/sparklemotion/nokogiri/issues/1111
Finally the command which worked for me
gem install nokogiri -- --with-xslt-dir=/usr/local/opt/libxslt

Related

Ruby: Compilation error during installation of ‘rails’ gem on macOS

When I install rails in macOS by running
$ sudo gem install rails
I got the following.
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150702-37637-10z8fhh.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.2
with the following patches applied:
- 0001-Revert-Missing-initialization-for-the-catalog-module.patch
- 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch
Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
************************************************************************
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-apple-darwin14/ports/libxml2/2.9.2... OK
Running patch with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch...
Running 'patch' for libxml2 2.9.2... OK
Running patch with /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch...
Running 'patch' for libxml2 2.9.2... OK
Running 'configure' for libxml2 2.9.2... OK
Running 'compile' for libxml2 2.9.2... ERROR, review '/Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ext/nokogiri/tmp/x86_64-apple-darwin14/ports/libxml2/2.9.2/compile.log' to see what happened.
*** 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/2.0/usr/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
/Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:279:in `block in execute': Failed to complete compile task (RuntimeError)
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `chdir'
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `execute'
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:70:in `compile'
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:110:in `cook'
from extconf.rb:278:in `block in process_recipe'
from extconf.rb:177:in `tap'
from extconf.rb:177:in `process_recipe'
from extconf.rb:475:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.6.2/gem_make.out
Building gems with native extensions is always a pain. You need to have several libs or compile tools installed. In case of nokogiri it's libxml. For this reason i would recommend to use rvm for getting started. RVM is not the cleanest tool, when it comes to unix philosophy, but it's a full-stack solution, meaning that it just works out of the box. It will install all the dependencies for you, using the default osx package manager. As a package manager i recommend homebrew.
#install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#install rvm into $HOME
brew install gpg
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable
rvm install ruby --latest
gem install rails #no sudo, as ruby is in $HOME

Error trying to reinstall rugged gem

I'm trying to reinstall rugged as it's causing issues with another program (Dandelion Deploy).
I've recently updated my RVM and Ruby, and installed cmake and pkg-config again, but I get this error when I run the following command: gem install rugged
Fetching: rugged-0.22.2.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing rugged:
ERROR: Failed to build gem native extension.
/Users/J/.rvm/rubies/ruby-2.0.0-p645/bin/ruby -r ./siteconf20150605-56781-qfplzm.rb extconf.rb
checking for gmake... no
checking for make... yes
checking for cmake... yes
checking for pkg-config... yes
-- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Unix Makefiles"
*** 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=/Users/J/.rvm/rubies/ruby-2.0.0-p645/bin/ruby
--use-system-libraries
extconf.rb:13:in `sys': ERROR: 'cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Unix Makefiles"' failed (RuntimeError)
from extconf.rb:66:in `block (2 levels) in <main>'
from extconf.rb:65:in `chdir'
from extconf.rb:65:in `block in <main>'
from extconf.rb:62:in `chdir'
from extconf.rb:62:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/J/.rvm/rubies/ruby-2.0.0-p645/lib/ruby/gems/2.0.0/gems/rugged-0.22.2 for inspection.
Results logged to /Users/J/.rvm/rubies/ruby-2.0.0-p645/lib/ruby/gems/2.0.0/extensions/x86_64-darwin-11/2.0.0/rugged-0.22.2/gem_make.out
I'm a frontender, so this is way out of my comfort zone. Any help appreciated!
Mac OSX 10.7.5, Lion
Solved it.
I installed the latest version of XCode I could (4.6.3) on OSX 10.7.5.
To get dandelion working, I installed the following gems: rugged, dandelion and net-sftp
and everything worked again.

'gem install sqlite3' error

When running the gem install sqlite3 command on Mac OS X I experience the following error message:
Users-MacBook-Pro:~ user$ gem install sqlite3
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/Users/user/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
checking for sqlite3.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=/Users/user/.rvm/rubies/ruby-2.1.2/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
/Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:1120:in `block in find_header'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from /Users/user/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/mkmf.rb:1119:in `find_header'
from extconf.rb:35:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.1.2/gems/sqlite3-1.3.9 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/sqlite3-1.3.9/gem_make.out
Users-MacBook-Pro:~ user$
I am relatively new to using the terminal, ruby on rails and ruby gems and have been scratching my head (i.e. searching google) for a few hours now, any help would be greatly appreciated. Have tried the sudo command but no luck there.
You should install sqlite3 in your OSX first
brew install sqlite3
Ok, so I ended up throwing the kitchen sink at this one in the end. Here are the steps I took to resolve the issue.
uninstalled RVM link
uninstalled App Store version of xcode as had it previously installed link
ran $ xcode-select --install in terminal to install command line tools
as I already have Homebrew installed I added Homebrews binary path to the front of the $PATH link
$ echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
$ source ~/.bash_profile
ran $ brew install sqlite3 command
reinstalled RVM
I believe the steps which mitigated the issue the most were 2,3,4 and 5.
Hope this helps!

Having troubles with installing ImageMagick on Maverick 10.9.3

The last two days I am fighting with configuration of ImageMagick and rmagick gem. I found several topics on SO, but none of them helped me out with this issue.
Recently, I've tried update also rvm, but it didn't help me neither. When I run now bundle update, the output is:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/adam/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/bin/clang... yes
checking for Magick-config... yes
Warning: Found more than one ImageMagick installation. This could cause problems at runtime.
/usr/local/bin/Magick-config reports version 6.8.6 Q8 is installed in /usr/local
/opt/ImageMagick/bin/Magick-config reports version 6.8.8 Q16 is installed in /opt/ImageMagick
Using 6.8.6 Q8 from /usr/local.
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.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=/Users/adam/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
/Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from /Users/adam/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
from extconf.rb:194:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/adam/.rvm/gems/ruby-2.0.0-p353/gems/rmagick-2.13.2 for inspection.
Results logged to /Users/adam/.rvm/gems/ruby-2.0.0-p353/extensions/x86_64-darwin-13/2.0.0/rmagick-2.13.2/gem_make.out
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.
How to proceed now - which ImageMagick to remove? Or, is there something else what am I overlooking?
The error hints at the problem:
Warning: Found more than one ImageMagick installation. This could
cause problems at runtime.
/usr/local/bin/Magick-config reports version 6.8.6 Q8 is installed in /usr/local
/opt/ImageMagick/bin/Magick-config reports version 6.8.8 Q16 is installed in /opt/ImageMagick Using 6.8.6 Q8 from /usr/local.
And also:
You have to install development tools first.
You can do this by entering the command xcode-select --install and clicking Install
This installs gcc among other things you need to compile ImageMagick and other sources.
Now remove one of your current installations of ImageMagick. Or remove both and install ImageMagick with homebrew:
brew update
brew install imagemagick
If that doesn't work here's some links I found that might help:
ImageMagick Installer: http://cactuslab.com/imagemagick/
Link

RMagick gem fails to install on Debian Stable

edit:[FIXED]
The problem was that I had it installed already, but didn't know, and tried to install from source. This created two versions and the gem didn't know which to use. I fixed it by going to the downloaded source and running
sudo make uninstall
Then I ran gem install rmagick again and it worked!
[ORIGINAL PROBLEM]
I'm trying to install the rmagick gem like in this railscast. Here's a snippet of what I put in my gemfile:
gem 'rmagick'
gem 'carrierwave'
And when I run bundle install I get the following output:
Installing rmagick (2.13.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/techusb/.rbenv/versions/1.9.3-p125/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 cc... yes
checking for Magick-config... yes
Warning: Found more than one ImageMagick installation. This could cause problems at runtime.
/usr/local/bin/Magick-config reports version 6.8.0 Q16 is installed in /usr/local
/usr/bin/Magick-config reports version 1.3.12 is installed in /usr
Using 6.8.0 Q16 from /usr/local.
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.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=/home/techusb/.rbenv/versions/1.9.3-p125/bin/ruby
/home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
from extconf.rb:193:in `<main>'
Gem files will remain installed in /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1 for inspection.
Results logged to /home/techusb/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/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.
Regarding this line:
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
I think I've exhausted all the information on how to fix this error via google/stackoverflow. I already tried installing the development packages and such. Not sure where to go from here. Any help greatly appreciated.
=> https://stackoverflow.com/a/10647962/1420038;
"The new correct way is to install libmagickwand-dev:
sudo apt-get install libmagickwand-dev
Then you should be able to install rmagick no problem."
works on debian 6.0.6

Resources