My Opera is closing 3rd of March

Ruby on Rails

Learn Ruby on Rails

Installing Hpricot on Ruby 1.9.1 on Windows

, ,

>IF YOU GET THIS ERROR OR ERROR SIMILAR ONE THEN GET TO THE SOLUTION:
gem install hpricot -v 0.8.2
Building native extensions. This could take a while...
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.


C:/Ruby19/bin/ruby.exe extconf.rb
checking for stdio.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=C:/Ruby19/bin/ruby
C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:362:in try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:431:in try_cpp'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:809:in block in have_header'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:668:in block in checking_for'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:274:in block (2 levels) in postpone'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:248:in open'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:274:in block in postpone'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:248:in open'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:270:in postpone'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:667:in checking_for'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:808:in have_header'
from extconf.rb:2:in '
Gem files will remain installed in C:/Ruby19/lib/ruby/gems/1.9.1/gems/hpricot-0.8.2 for inspection.
Results logged to C:/Ruby19/lib/ruby/gems/1.9.1/gems/hpricot-0.8.2/ext/fast_xs/gem_make.out


===============================================SOLUTION=============================================

Try TO install the windows ruby devkit (rubyinstaller.org/downloads).

STEP 1: Download the self-extracting DevKit-A.B.C-CCYYMMDD-sfx.exe archive.
STEP 2: Extract the DevKit contents into a directory with no spaces, e.g. – C:\DevKit.
STEP 3: Follow the steps below:
i. cd <DEVKIT_INSTALL_DIR> from Step 2 above.
ii. ruby dk.rb init to generate the config.yml file to be used later in this Step. Your installed Rubies will be listed there (only those installed by a RubyInstaller package are detected at present).
iii. edit the generated config.yml file to include installed Rubies not automagically discovered or remove Rubies you do not want to use the DevKit with.
iv. finally, ruby dk.rb install to DevKit enhance your installed Rubies. This step installs (or updates) an operating_system.rb file into the relevant directory needed to implement a RubyGems pre_install hook and a devkit.rb helper library file into <RUBY_INSTALL_DIR>\lib\ruby\site_ruby.
STEP 4: Confirm your Ruby environment is correctly using the DevKit by running gem install rdiscount --platform=ruby. RDiscount should install correctly and you should see Temporarily enhancing PATH to include DevKit... in the screen messages. Next run ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new('**Hello RubyInstaller**').to_html" to confirm that the rdiscount gem is working.


Now that you’ve installed the DevKit, you should be able to use many of the native C RubyGems without problems.

What exactly is Ruby on Rails?

Write a comment

New comments have been disabled for this post.

February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28