Error: Failed to Build Gem Native Extension When Installing Rails on MAC Mountian Lion Os

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:

  1. 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+.

  2. 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!

  1. Install XCode 4.4
  2. Install command line tools (from the preferences in Xcode)
  3. Install XQuartz
  4. Install ImageMagic (brew install —vd imagemagick)
  5. sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
  6. mdfind MagickWand.h (to get the path to the MagickWand.h file)
  7. 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



Leave a reply



Submit