codemancers / rbkit

A new profiler for Ruby. With a GUI
http://rbkit.c9s.dev/
MIT License
358 stars 11 forks source link

Gem install fails if missing zeromq/msgpack on OSX #102

Closed schneems closed 9 years ago

schneems commented 9 years ago

When trying to install the rubygem, it failed until i manually ran brew install. To reproduce, i uninstalled msgpack and zeromq and the gem then tried to reinstall.

$ brew uninstall msgpack
Uninstalling /usr/local/Cellar/msgpack/0.5.9...
2.2.0  ~
$ gem uninstall rbkit
Successfully uninstalled rbkit-0.1.10
2.2.0  ~
$ gem install rbkit
Fetching: rbkit-0.1.10.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing rbkit:
    ERROR: Failed to build gem native extension.

    /Users/richardschneeman/.rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150116-79688-njbp3x.rb extconf.rb
checking for rb_postponed_job_register_one()... yes
checking for rb_profile_frames()... yes
checking for rb_tracepoint_new()... yes
checking for RUBY_INTERNAL_EVENT_NEWOBJ... yes
checking for main() in -lzmq... no
checking for libtool... yes
checking for autoconf... yes
checking for automake... no
*** 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
    --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=/Users/richardschneeman/.rubies/ruby-2.2.0/bin/$(RUBY_BASE_NAME)
    --with-zmqlib
    --without-zmqlib
extconf.rb:33:in `block in download_and_install_zeromq_from_source': automake needed by zeromq not found. (RuntimeError)
    from extconf.rb:32:in `each'
    from extconf.rb:32:in `download_and_install_zeromq_from_source'
    from extconf.rb:80:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/richardschneeman/.gem/ruby/2.2.0/gems/rbkit-0.1.10 for inspection.
Results logged to /Users/richardschneeman/.gem/ruby/2.2.0/extensions/x86_64-darwin-13/2.2.0-static/rbkit-0.1.10/gem_make.out
emilsoman commented 9 years ago

@schneems This is related to zeromq installation and not msgpack. The gem downloads and installs zeromq for you if it's not found on your system. Before doing that it checks if the following executables are available : ['libtool', 'autoconf', 'automake'] . These are prerequisites for zeromq installation as documented in their installation page. If we don't find it we fail with an error message. I guess adding this piece of information to the README should do ?

robmiller commented 9 years ago

I got the same error (although a failure on autoconf rather than automake) despite having autoconf, libtool, and automake installed via homebrew.

After running:

brew unlink autoconf && brew link autoconf

…I was able to get things installed. Hopefully this helps someone else!

emilsoman commented 9 years ago

Documented this in the README #109