Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred while installing hitimes (1.2.2), and Bundler cannot continue. #27

Closed
andreas-venturini opened this issue Oct 11, 2014 · 23 comments

Comments

@andreas-venturini
Copy link

Using Ubuntu 14.04, my output when running gem install hitimes -v '1.2.2'

Building native extensions.  This could take a while...
ERROR:  Error installing hitimes:
    ERROR: Failed to build gem native extension.

    /home/andreas/.rbenv/versions/2.0.0-p481/bin/ruby extconf.rb
checking for clock_gettime() in -lrt... *** 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=/home/andreas/.rbenv/versions/2.0.0-p481/bin/ruby
    --with-rtlib
    --without-rtlib
/home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:534:in `try_link'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:720:in `try_func'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:950:in `block in have_library'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:310:in `open'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:310:in `open'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
    from /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/2.0.0/mkmf.rb:945:in `have_library'
    from extconf.rb:10:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/hitimes-1.2.2 for inspection.
Results logged to /home/andreas/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/extensions/x86_64-linux/2.0.0-static/hitimes-1.2.2/gem_make.out
@copiousfreetime
Copy link
Owner

Apologies for taking so long to reply. I've been offline for a few days.

I think you need to install the necessary dependencies needed to build and install ruby C extensions. I think this should fix it: sudo apt-get install build-essential.

Once that is done, just rerun your gem install hitimes.

@andreas-venturini
Copy link
Author

Thank you. I thought I had already installed the build-essential package. Now it works.

@copiousfreetime
Copy link
Owner

Glad that worked for you. When you find a bug in hitimes, please let me know so I can fix it.

@krawatcoder
Copy link

Hi,
I am running ruby-rails on windows, i am not able to install hitimes. Getting following error:
ERROR: Error installing hitimes:
The 'hitimes' native gem requires installed build tools.

@copiousfreetime
Copy link
Owner

hi @krawatcoder Normally I ship an x86 binary in hitimes, unfortunately I haven't reconstructed my windows cross compilation buildchain yet, so it is falling behind.

Which version of hitimes are you wanting to get installed? Are you installing hitimes for you application dependency or is it a dependency from another gem?

@krawatcoder
Copy link

@copiousfreetime I want to install 1.2.2

@copiousfreetime
Copy link
Owner

@krawatcoder Sounds good, I'm on a vacation right now and will be back home on Dec 3, so I'll get to this when I return home. I have opened Issue #30 to track the windows binary gem. Please follow up on further conversation there.

@crispen-smith
Copy link

What's the current state of hitimes support for Yosemite? I'm trying to build guard to update my web-development life-cycle to support live-reload and I'm getting this error message.

I"m not a ruby guy so this is all very new to me.

@copiousfreetime
Copy link
Owner

@crispen-smith hitimes should work on yosemite, at least I have heard reports from folks and it works just fine. If you can paste the errors you are seeing into a new ticket we'll go from there.

@crispen-smith
Copy link

And, this morning it seems to work just fine.
Only thing that I changed was installing while in root rather than my project directory.

@copiousfreetime
Copy link
Owner

that's odd, I'm not sure what to say.

@crispen-smith
Copy link

Understandable. I think for the moment, if it's working I'm not going to delve into it further.

@brunzino
Copy link

Installing fails for me in Yosemite. I updated bundler and did try installing from ~/ and / directories per @crispen-smith but no love. Error messages below

$ gem install hitimes -v '1.2.2'
Building native extensions.  This could take a while...
ERROR:  Error installing hitimes:
    ERROR: Failed to build gem native extension.

    /Users/nbruns/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
creating Makefile

make "DESTDIR="
compiling hitimes.c
compiling hitimes_instant_clock_gettime.c
compiling hitimes_instant_osx.c
compiling hitimes_instant_windows.c
compiling hitimes_interval.c
compiling hitimes_stats.c
linking shared-object hitimes/2.0/hitimes.bundle
ld: warning: directory not found for option '-L/Users/mpapis/.sm/pkg/active/lib'
ld: framework not found CoreServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [hitimes.bundle] Error 1

Gem files will remain installed in /Users/nbruns/.rvm/gems/ruby-2.0.0-p247/gems/hitimes-1.2.2 for inspection.
Results logged to /Users/nbruns/.rvm/gems/ruby-2.0.0-p247/gems/hitimes-1.2.2/ext/hitimes/c/gem_make.out

@brunzino
Copy link

Oops, just reread messages. Pasting into a new ticket now...

@copiousfreetime
Copy link
Owner

for posterity, please see rvm/rvm#3360

@javadudealok
Copy link

sudo gem install hitimes
Building native extensions. This could take a while...
ERROR: Error installing hitimes:
ERROR: Failed to build gem native extension.

/usr/bin/ruby2.2 -r ./siteconf20150630-26932-1uskrfd.rb extconf.rb

mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.2.0/gems/hitimes-1.2.2 for inspection.
Results logged to /var/lib/gems/2.2.0/extensions/x86_64-linux/2.2.0/hitimes-1.2.2/gem_make.out

@copiousfreetime
Copy link
Owner

@javadudealok I'll need some more information, and this does not appear to be a bundler oriented problem, could you please open this up in a new ticket and also paste in the output of:

  1. sudo gem env
  2. /usr/bin/ruby2.2 -r rbconfig -r pp -e 'pp RbConfig::CONFIG'
  3. gem env

I have a suspicion that the gem command you executed does not go with the ruby version you think it should.

@javadudealok
Copy link

The gem version is 2.4.5 and ruby 2.2.2 .
Is that an issue

@copiousfreetime
Copy link
Owner

@javadudealok conversation moved to #45

@qibo-cn
Copy link

qibo-cn commented Feb 24, 2016

@copiousfreetime
my gem is 1.8.23, ruby is 1.9.3p484
build-essential has been installed.
but I still have the same problem, should i upgrade gem and ruby?

@copiousfreetime
Copy link
Owner

@qibo-cn if you have installed ruby via rvm then you will alwso need apt-get install libgmp-dev as rvm installs a binary ruby that is compiled against libgmp.

For your best bet to cover all situations that I know of for rvm based ruby installs: apt-get install libgmp-dev build-essential

If you are installing ruby via apt-get then you also need apt-get install ruby*-dev

I would encourage you to use a ruby version 2.2 or greater. Version 1.9 has been out of support for over a year and ruby 2.0 has ended support as of 2016-02-24

@jufyao
Copy link

jufyao commented May 3, 2016

Hi @copiousfreetime, when install hitimes 1.2.4, got :

mical@ubuntu:~/vertive/reporting$ gem install hitimes -v '1.2.4'
Building native extensions. This could take a while...
ERROR: Error installing hitimes:
ERROR: Failed to build gem native extension.

/home/mical/.rvm/rubies/jruby-1.7.22/bin/jruby -r ./siteconf20160502-4244-ynjjt4.rb extconf.rb

NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.

(root) at /home/mical/.rvm/rubies/jruby-1.7.22/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1040
(root) at /home/mical/.rvm/rubies/jruby-1.7.22/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
(root) at extconf.rb:2

can you please help?
thanks

@copiousfreetime
Copy link
Owner

@jufyao that would be my mistake, I forgot to push the java version of the gem to rubygems last night when I released. That has been fixed and you should be good to go.

% ruby -v
jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]
% gem install hitimes -v 1.2.4
Fetching: hitimes-1.2.4-java.gem (100%)
Successfully installed hitimes-1.2.4-java
1 gem installed
% irb
>> require 'hitimes'
=> true
>> RUBY_DESCRIPTION
=> "jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]"
>> Hitimes::Interval.measure { puts "Oops, forgot to push the java gem" }
Oops, forgot to push the java gem
=> 0.000142378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants