Skip to content

gem install fails on windows #54

Closed
okigan opened this Issue Jul 8, 2012 · 9 comments

7 participants

@okigan
okigan commented Jul 8, 2012

gem install ruhoh fails on windows with:

    ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe extconf.rb
    extconf.rb:7: Use RbConfig instead of obsolete and deprecated Config.
    checking for yaml.h... no
    yaml.h is missing. Try 'port install libyaml +universal' or 'yum install libyaml-devel'
    *** extconf.rb failed ***

this can be boiled down to problem in installing gem install psych. This guy figured a work around:
http://jonforums.github.com/ruby.html, but this is way too much and way unsupported.

@plusjade
ruhoh member
plusjade commented Jul 8, 2012

Anyone know if and why Jekyll on windows works? What's in ruhoh that isn't in Jekyll?

@Daelex
Daelex commented Jul 15, 2012

I had the same problem and the solution was to download libyaml, and to specify the lib directory while the gem installation.

Download https://github.com/jonforums/libyaml-waf/downloads extract it, for example to C:\DevKit\libyaml\.
Add C:\DevKit\libyaml\bin to your %PATH%
Run gem install ruhoh --version '1.0.0.alpha' -- --with-libyaml-dir=C:\DevKit\libyaml

@okigan
okigan commented Jul 15, 2012

confirmed install passed (have not checked if it works :)

btw I think path modification is not needed see "Temporarily enhancing" log line below

C:...>gem install ruhoh --version '1.0.0.alpha' -- --with-libyaml-dir=C:\DevKit\libyaml
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Fetching: ruhoh-1.0.0.alpha.gem (100%)
Successfully installed psych-1.3.3
Successfully installed ruhoh-1.0.0.alpha
2 gems installed
Installing ri documentation for psych-1.3.3...
Installing ri documentation for ruhoh-1.0.0.alpha...
Installing RDoc documentation for psych-1.3.3...
Installing RDoc documentation for ruhoh-1.0.0.alpha...

@Painted-Fox

I came across this issue and the solution above allowed me to install ruhoh without error. However, once I run it in the command line I get an error in a popup that reads: "The program can't start because yaml.dll is missing from your computer. Try reinstalling the program to fix this problem."

To solve the issue I installed psych by following the instructions here found in the article: Hacking a RubyGem, which I found through the wiki page: Installing psych on Windows. It seems like the trick is to build psych with libyaml statically linked.

I'm now able to run ruhoh from the Windows command line without any errors.

Is possible to remove psych as a dependency? I don't think the library or the Ruby DevKit are going to make it easy to install on Windows any time soon.

@Painted-Fox

Since #77 is closed, this should no longer be a problem as long as you use Ruby 1.9.2 or better on Windows.

@mattrobbins

I am using Ruby 1.9.3 and I am getting this error. Trying the instructions above to see if it works.

@bliker
bliker commented May 18, 2013

I am running Ruby 2.0.0 and getting the same option. And I tried that, Did not work. I get

checking for yaml.h... yes
checking for yaml_get_version()... -lyaml
libyaml is missing.
@plusjade
ruhoh member

@bliker please see if you can install ruhoh 2.1. There seems to be an issue with libyaml and ruby 2.0.0 in general as I've read; similar to what's mentioned here: https://coderwall.com/p/tptocq

I'll close this particular issue because it's now quite dated but if you are still trying ruhoh and still having problems feel free to open a new issue relative to 2.1.

@plusjade plusjade closed this May 25, 2013
@victorwoo

still missing "yaml.h" in ruby 2.0.0p247 + gem 2.0.3 + ruhoh 2.2

D:\blog>ruby -v
ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
D:\blog>gem -v
2.0.3

D:\blog>gem install ruhoh
Successfully installed ruhoh-2.2
Parsing documentation for ruhoh-2.2
1 gem installed

D:\blog>bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using directory_watcher (1.4.1)
Using mini_portile (0.5.1)
Using mustache (0.99.4)
Using nokogiri (1.6.0)
Installing psych (1.3.4)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.

C:/ruby-2.0.0-p247-i386-mingw32/bin/ruby.exe extconf.rb

checking for yaml.h... no
yaml.h is missing. Try 'port install libyaml +universal' or 'yum install libyaml
-devel'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.