Dakota Jay Whipple
Dakota Jay Whipple

Reputation: 550

Installing eventmachine on windows 8

I'm trying to install eventmachine so I can run this program https://github.com/alexagranov/earnings_date_finder to see what it does.

I get this error:

C:\Users\Dakota\Downloads\rails\rails_apps\earnings>ruby script/rails
Could not find eventmachine-0.12.10 in any of the sources
Run `bundle install` to install missing gems.

When I run 'bundle install' I get this:

C:\Users\Dakota\Downloads\rails\rails_apps\earnings>bundle install
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies...
Using rake (0.9.2.2)
Using abstract (1.0.0)
Using activesupport (3.0.11)
Using builder (2.1.2)
Using i18n (0.5.0)

Using activemodel (3.0.11)
Using erubis (2.6.6)
Using rack (1.2.4)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.31)
Using actionpack (3.0.11)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.2.19)
Using actionmailer (3.0.11)
Using arel (2.0.10)
Using activerecord (3.0.11)
Using activeresource (3.0.11)
Using archive-tar-minitar (0.5.2)
Using bundler (1.3.5)
Using columnize (0.3.4)
Using daemons (1.1.4)
Installing eventmachine (0.12.10)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.

    C:/Users/Dakota/Downloads/rails/ruby/bin/ruby.exe extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.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:/Users/Dakota/Downloads/rails/ruby/bin/ruby
C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:431:in `try_do':
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:546:
in `block in try_compile'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:499:
in `with_werror'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:546:
in `try_compile'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:736:
in `try_var'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:1023
:in `block in have_var'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:892:
in `block in checking_for'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:337:
in `block (2 levels) in postpone'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:307:
in `open'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:337:
in `block in postpone'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:307:
in `open'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:333:
in `postpone'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:891:
in `checking_for'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:1022
:in `have_var'
        from extconf.rb:16:in `<main>'


Gem files will remain installed in C:/Users/hgc33_000/Downloads/rails/ruby/lib/r
uby/gems/2.0.0/gems/eventmachine-0.12.10 for inspection.
Results logged to C:/Users/hgc33_000/Downloads/rails/ruby/lib/ruby/gems/2.0.0/ge
ms/eventmachine-0.12.10/ext/gem_make.out
An error occurred while installing eventmachine (0.12.10), and Bundler cannot
continue.
Make sure that `gem install eventmachine -v '0.12.10'` succeeds before bundling.

I've tried many different ways to install eventmachine but every way gives me the same error.

For the record 'gem install eventmachine --pre' gives me this error:

C:\Users\Dakota\Downloads\rails\rails_apps\earnings>gem install eventmachine --pre
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing eventmachine:
        ERROR: Failed to build gem native extension.

    C:/Users/Dakota/Downloads/rails/ruby/bin/ruby.exe extconf.rb
checking for main() in -lssl... *** 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:/Users/Dakota/Downloads/rails/ruby/bin/ruby
        --with-openssl-config
        --without-openssl-config
        --with-pkg-config
        --without-pkg-config
        --with-ssl-dir
        --without-ssl-dir
        --with-ssl-include
        --without-ssl-include=${ssl-dir}/include
        --with-ssl-lib
        --without-ssl-lib=${ssl-dir}/
        --with-ssllib
        --without-ssllib
C:/Users/hgc33_000/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:431:in `try_do':
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:516:
in `try_link0'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:531:
in `try_link'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:717:
in `try_func'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:947:
in `block in have_library'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:892:
in `block in checking_for'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:337:
in `block (2 levels) in postpone'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:307:
in `open'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:337:
in `block in postpone'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:307:
in `open'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:333:
in `postpone'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:891:
in `checking_for'
        from C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/2.0.0/mkmf.rb:942:
in `have_library'
        from extconf.rb:5:in `block in check_libs'
        from extconf.rb:5:in `each'
        from extconf.rb:5:in `all?'
        from extconf.rb:5:in `check_libs'
        from extconf.rb:39:in `manual_ssl_config'
        from extconf.rb:61:in `<main>'


Gem files will remain installed in C:/Users/Dakota/Downloads/rails/ruby/lib/r
uby/gems/2.0.0/gems/eventmachine-1.0.3 for inspection.
Results logged to C:/Users/Dakota/Downloads/rails/ruby/lib/ruby/gems/2.0.0/ge
ms/eventmachine-1.0.3/ext/gem_make.out

Upvotes: 1

Views: 3319

Answers (3)

Ittipan Langkulanon
Ittipan Langkulanon

Reputation: 1

After following Fera's steps. Yes it now did install with message

Successfully installed eventmachine-1.0.3
1 gem installed

but not usable.

in \lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3\ext there was an error in mkmf.log and nothing was actually build

package configuration for openssl is not found
have_library: checking for main() in -lssl... -------------------- no

Upvotes: 0

Fernando Vieira
Fernando Vieira

Reputation: 3333

I could install it, doing this steps:

1) tried a normal install:

gem install eventmachine

it fetched the version 1.0.3 of the gem, but failed in the make, because of a variable declaration conflit

2) edited the file:

c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3\ext\project.h

and commented the line 97

//typedef int pid_t;

3) then, i've opened command prompt, and went to the gem folder

c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3

and runned:

gem build eventmachine.gemspec

4) it generated a eventmachine.gem file on the folder... So I've copied a file to a c:\tmp folder, and went to that folder and from there, I've typed:

gem install eventmachine-1.0.3.gem --local

And it installed successfully!

Upvotes: 6

thoughtpunch
thoughtpunch

Reputation: 1937

Found you via Reddit!

Try using the precompiled eventmachine gem

gem install eventmachine --pre

You're getting this issue because the eventmachine gem (or one of it's dependencies) is written in C and needs to be compiled by a locally available C compiler (LLVM, GCC, etc).

If you continue to get this issue after including the --pre flag in your gemfile, I would uninstall all local eventmachine versions and take a look at these links:

  1. eventmachine issue #411
  2. issue #217

Hope this helps!

Upvotes: 0

Related Questions