Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. #3816

Closed
jovistruck opened this issue Jul 9, 2015 · 10 comments
Closed

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. #3816

jovistruck opened this issue Jul 9, 2015 · 10 comments

Comments

@jovistruck
Copy link

I ran the command ~/work/pav-monitoring/jenkins_dashboard$ bundle
Instead, what actually happened was...

Error details

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby2.1 extconf.rb

rake 10.1.0 not found in GEM_PATH

/home/jov/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:71:in initialize': Permission denied @ rb_sysopen - /usr/bin/rdoc (Errno::EACCES) from /home/jov/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:71:inopen'
from /home/jov/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:71:in block in try_to_fix_binstubs' from /home/jov/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:69:inmap'
from /home/jov/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:69:in try_to_fix_binstubs' from /home/jov/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:46:inblock in execute_no_wrapper'
from /home/jov/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:44:in each' from /home/jov/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:44:inexecute_no_wrapper'
from extconf.rb:19:in `

'
bundler 1.10.5
dashing 1.3.4
executable-hooks 1.3.2
rack 1.5.5
rdoc 4.1.0

extconf failed, exit code 1

Gem files will remain installed in /home/jov/.rvm/gems/ruby-2.2.1@global/gems/executable-hooks-1.3.2 for inspection.
Results logged to /home/jov/.rvm/gems/ruby-2.2.1@global/extensions/x86_64-linux/2.1.0/executable-hooks-1.3.2/gem_make.out

  /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in `run'
  /usr/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
  /usr/lib/ruby/2.1.0/tempfile.rb:324:in `open'
  /usr/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
  /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
  /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
  /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
  /usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
  /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
  /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
  /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
  /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
  /usr/lib/ruby/2.1.0/rubygems/specification.rb:1436:in `block in build_extensions'
  /usr/lib/ruby/2.1.0/rubygems/user_interaction.rb:45:in `use_ui'
  /usr/lib/ruby/2.1.0/rubygems/specification.rb:1434:in `build_extensions'
  /usr/lib/ruby/2.1.0/rubygems/stub_specification.rb:60:in `build_extensions'
  /usr/lib/ruby/2.1.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
  /usr/lib/ruby/2.1.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
  /usr/lib/ruby/2.1.0/rubygems/specification.rb:924:in `each'
  /usr/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find'
  /usr/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find_inactive_by_path'
  /usr/lib/ruby/2.1.0/rubygems.rb:185:in `try_activate'
  /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
  /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/vendor/net/http/persistent.rb:12:in `<top (required)>'
  /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/vendored_persistent.rb:11:in `<top (required)>'
  /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/fetcher.rb:1:in `<top (required)>'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/cli/install.rb:98:in `run'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/cli.rb:162:in `install'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/cli.rb:10:in `start'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/bin/bundle:20:in `block in <top (required)>'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
  /home/jov/.rvm/gems/ruby-2.2.1/gems/bundler-1.10.5/bin/bundle:18:in `<top (required)>'
  /usr/local/bin/bundle:23:in `load'
  /usr/local/bin/bundle:23:in `<main>'

Environment

Bundler   1.10.5
Rubygems  2.2.2
Ruby      2.1.2p95 (2014-05-08 revision 0) [x86_64-linux-gnu]
GEM_HOME  /home/jov/.rvm/gems/ruby-2.2.1
GEM_PATH  /home/jov/.rvm/gems/ruby-2.2.1:/home/jov/.rvm/gems/ruby-2.2.1@global
RVM       1.26.11 (latest)
Git       2.1.4
rubygems-bundler (1.4.4)
@jovistruck
Copy link
Author

sudo bundle 

worked.

@darkn3rd
Copy link

darkn3rd commented Oct 2, 2015

I have had this same issue on a OS X 10.10, but sudo bundle doesn't work. :)

@GianFF
Copy link

GianFF commented Oct 13, 2015

I have a very same problem on Ubuntu 15.04 , and sudo bundle does not work , but gem install bundler habe been solved my problem .

@zainalmustofa
Copy link

I have same issue and solve with this flori/json#253

@renra
Copy link

renra commented Nov 3, 2015

Just ran into the same problem on debian after upgrading to ruby 2.2.3. Unfortunately flori/json#253 did not help.

@bsed
Copy link

bsed commented Nov 9, 2015

rvm how to di in error

@ASerzhant
Copy link

GianFF thank you man!

@shabbir-ahmed
Copy link

I run bundle install

Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing
your bundle as root will break this application for all non-root users on this
machine.
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.0.0
Using concurrent-ruby 1.0.4
Using i18n 0.7.0
Using minitest 5.10.1
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 2.0.1
Installing nio4r 1.2.1 with native extensions
Using websocket-extensions 0.1.2
Using mime-types-data 3.2016.0521
Using arel 7.1.4
Installing debug_inspector 0.0.2 with native extensions
Using bundler 1.13.7
Installing byebug 9.0.6 with native extensions
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using method_source 0.8.2
Using thor 0.19.4
Using multi_json 1.12.1
Using json 1.8.3
Installing mysql2 0.4.5 with native extensions
Using rdoc 4.3.0
Using sass 3.4.23
Using tilt 2.0.5
Using turbolinks-source 5.0.0
Using tzinfo 1.2.2
Installing nokogiri 1.7.0.1 with native extensions
Using rack-test 0.6.3
Using sprockets 3.7.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r

/usr/bin/ruby2.3 -r ./siteconf20170109-3150-tw7km1.rb extconf.rb
--with-cflags=-std=c99
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.3.0/gems/nio4r-1.2.1 for
inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem_make.out

An error occurred while installing nio4r (1.2.1), and Bundler cannot
continue.
Make sure that gem install nio4r -v '1.2.1' succeeds before bundling.

@PunniyaPrabhu
Copy link

GianFF thanks a lot that worked for me as well

@shingo-nakanishi
Copy link

My Case

Mac
in mkmf.log

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

After Update macOS, this log message shown.
Open Xcode, and agree license. I can install this gem.

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

No branches or pull requests