Rmagick failed to build gem native on OSX Lion
To fix this I had to uninstall then reinstall RVM. Then run 'brew install ruby' to get the latest version. Then 'bundle'.
I hope this helps others who ran into the exact error I did.
Rails installation error - Failed to build gem native extension
I found the answer here, http://net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/
Although by no means was this a walk in the park, due to version conflicts, the tut is over a year old and Rails now requires at least Ruby 1.9.3 and you need to install Command Line tools in Xcode. This tut uses RVM.
I tried Rails Installer which sounds a lot easier than doing it this way but that also gave me an error. I think I had major version conflicts going on. If you are trying to install Rails then I'd try Rails Installer first. Here's a very recent tut on installing it, http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac
gem install rmagick -v 2.13.1 error Failed to build gem native extension on Mac OS 10.9.1
I strongly suggest using something like HomeBrew, if you are not already, to manage OSX packages. There are alternatives, including MacPorts.
RMagic is simply a ruby interface with ruby bindings for the underlying ImageMagic package.
I would make sure the latest imagemagick is installed:
brew install imagemagick
Or, if already installed:
brew upgrade imagemagick
Or, per this answer:
# install latest command line tools via xcode
# make sure you have the latest homebrew with the latest packages
brew update
# uninstall imagemagick and then reinstall to make use updated compiler
brew uninstall imagemagick
brew install imagemagick
# uninstall rmagick then reinstall to ensure native extensions are built against
# latest imagemagick
gem uninstall rmagick
gem install rmagick # or bundle
Additionally, you can run:
brew doctor
to identify any issues that may affect the building of these packages.
Update
Two approaches:
RMagick was recently updated to fix build issues related to the latest ImageMagick. Use version 2.13.2. Per the RMagick README:
This release will fix the installation issues due to ruby 1.9.3 and ImageMagick 6.8+.
Probably the better approach. Replace rmagick with mini_magick as mini_magick is being actively developed and rmagick is not. Imagemagick is also in active development, so as it's API changes, RMagick's dated API will become more and more stale.
error installing rmagick gem on OSX - ERROR: Failed to build gem native extension
What I found here perfectly works on Ubuntu:
sudo apt-get install libxml2-dev libxslt1-dev imagemagick libmagickwand-dev
and then,
bundle install
as usual.
HTH
Can't install RMagick on OS X Mountain Lion
Fixed it by following these steps. Arrggh!
- Install XCode 4.4
- Install command line tools (from the preferences in Xcode)
- Install XQuartz
- Install ImageMagic (brew install —vd imagemagick)
- sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
- mdfind MagickWand.h (to get the path to the MagickWand.h file)
- C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick gem install rmagick
Upgrade to Lion, failed to build gem native extensions
It appears that you need to install Xcode's Unix Development Tools.
You can install the Unix tools when you install Xcode from the Mac App Store: http://itunes.apple.com/us/app/xcode/id448457090?mt=12
Related Topics
Spinning Background Tasks in Rails
Ruby Source Code Analyzer (Something Like Pylint)
What Does 'Def Self.Function' Name Mean
Trying to Set Up Postgres for Ror App, Getting Error - Fe_Sendauth: No Password Supplied
Is There Equivalent for PHP's Print_R in Ruby/Rails
How to Combine Overlapping Time Ranges (Time Ranges Union)
I Have a Rails Task: Should I Use Script/Runner or Rake
How to Encode Media in Base64 Given Url in Ruby
Combination of Two Arrays in Ruby
Ruby Gemspec Dependency: Is Possible Have a Git Branch Dependency
Ruby Datetime Parsing from 'Mm/Dd/Yyyy' Format
Relationship Like Twitter Followers/Followed in Activerecord
Warning: Constant ::Fixnum Is Deprecated When Generating New Model