when I run gem install rmagick-2.13.1.gem
from the directory in which rmagick-2.13.1.gem is I get an Error saying that it failed to build gem native extension, belo
First of all clear your path environment variables. (This is the main step that people often skip, but very important). This is the main reason for the error you're facing.
Then install the rails installer (2.0.0) from here : http://railsinstaller.org/en
It'll set up ruby, rails, and everything else you need. This will also set up your environment path variables for you as well.
Next install imagemagick 6.7.9.9 or lower and while installing check the option to include C headers. Make sure you install it within the rails installer folder.
Then type this in your command prompt path=c:\RailsInstaller\ImageMagick-6.7.9-Q8;%path%
or whatever version you have.
Then type
gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"'
Finally edit C:\RailsInstaller\Ruby2.0.0\setup_environment.bat to include the path to ImageMagic
At line 25: SET PATH=c:\RailsInstaller\ImageMagick-6.7.9-Q8;
or whatever version you have