Trying to use rest-client gem in ruby but keep getting error: "WARNING: The rest_client gem is deprecated and will be removed from RubyGems. Please use rest-client gem instead."
Even though my code uses 'rest-client' and not 'rest_client'
#!/usr/bin/ruby
require 'rest-client'
Also, when i try to do 'gem install rest-client' it fails with:
Building native extensions. This could take a while...
ERROR: Error installing rest-client:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 mkrf_conf.rb
Building native extensions. This could take a while...
/usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
/usr/bin/ruby2.1 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.1.0/gems/unf-0.2.0.beta2/ext/gems/gems/unf_ext-0.0.7.2 for inspection.
Results logged to /var/lib/gems/2.1.0/gems/unf-0.2.0.beta2/ext/gems/extensions/x86_64-linux/2.1.0/unf_ext-0.0.7.2/gem_make.out
from /usr/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
from /usr/lib/ruby/2.1.0/tempfile.rb:324:in `open'
from /usr/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchronize'
from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
from /usr/lib/ruby/2.1.0/rubygems/installer.rb:677:in `build_extensions'
from /usr/lib/ruby/2.1.0/rubygems/installer.rb:232:in `install'
from /usr/lib/ruby/2.1.0/rubygems/resolver/specification.rb:78:in `install'
from /usr/lib/ruby/2.1.0/rubygems/request_set.rb:206:in `block in install_into'
from /usr/lib/ruby/2.1.0/rubygems/request_set.rb:198:in `each'
from /usr/lib/ruby/2.1.0/rubygems/request_set.rb:198:in `install_into'
from /usr/lib/ruby/2.1.0/rubygems/request_set.rb:119:in `install'
from /usr/lib/ruby/2.1.0/rubygems/dependency_installer.rb:389:in `install'
from mkrf_conf.rb:15:in `<main>'
rake failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/unf-0.2.0.beta2 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/unf-0.2.0.beta2/gem_make.out
Thanks for any help
I didn't have ruby dev installed... doh!
gem install: Failed to build gem native extension (can't find header files)
sudo apt-get install ruby-dev
fixed my problem
Related
I'm trying to set up my personal website via github.io. But when I enter the "bundle install" command I get the following error. I couldn't find the exact cause of the problem and I even reinstalled them all.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 extconf.rb
creating Makefile
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/builder.rb:12:in
`build_libv8!': failed to download node 16.10.0 (Libv8::Node::BuilderError)
from
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/location.rb:30:in
`install!'
from extconf.rb:9:in `<main>'
==== in
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
==== running
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/libexec/download-node
extconf failed, exit code 1
Gem files will remain installed in
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0 for inspection.
Results logged to
C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/libv8-node-16.10.0.0/gem_make.out
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:102:in `run'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:28:in `build'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:171:in `build_extension'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:205:in `block in
build_extensions'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in `each'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in `build_extensions'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/installer.rb:843:in `build_extensions'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/rubygems_gem_installer.rb:72:in
`build_extensions'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/source/rubygems.rb:207:in
`install'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/gem_installer.rb:54:in
`install'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/parallel_installer.rb:186:in
`do_install'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:62:in
`apply_func'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:57:in
`block in process_queue'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:54:in
`loop'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:54:in
`process_queue'
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:91:in
`block (2 levels) in create_threads'
An error occurred while installing libv8-node (16.10.0.0), and Bundler cannot
continue.
In Gemfile:
mini_racer was resolved to 0.6.3, which depends on
libv8-node
I updated these (gem, ruby, etc) but still nothing changed. What do you suggest I do, thanks in advance.
Have you checked for potential differences in the Gemfile? I recommend you check out this potential solution.
I have win7x64 and struggling to install ruby-debug-ide to use debugger in my ide. It is failing to build gem native extensions
have tried everything i could find through net
--verbose, --pre, --with ruby etc
Its still failing (
Can anyone give some tip please? thanks
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
$ gem install ruby-debug-ide
Building native extensions. This could take a while...
System cannot find path specified
ERROR: Error installing ruby-debug-ide:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby231-x64/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.0/ext
C:/Ruby231-x64/bin/ruby.exe mkrf_conf.rb
'Ёбв?┐? -? г¤ ?вбп - cвЁ гЄ § --лc Їгвм.
'Ёбв?┐? -? г¤ ?вбп - cвЁ гЄ § --лc Їгвм.
Installing base gem
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Failed to build gem native extension.
current directory: C:/Ruby231-x64/lib/ruby/gems/2.3.0/gems/debase-0.2.2.beta9/ext
C:/Ruby231-x64/bin/ruby.exe -r ./siteconf20170120-10104-1f4a8us.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby231-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/debase-0.2.2.beta9/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby231-x64/lib/ruby/gems/2.3.0/gems/debase-0.2.2.beta9 for inspection.
Results logged to C:/Ruby231-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/debase-0.2.2.beta9/gem_make.out
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:92:in `run'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/ext_conf_builder.rb:48:in `block in build'
C:/Ruby231-x64/lib/ruby/2.3.0/tempfile.rb:295:in `open'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/ext_conf_builder.rb:31:in `build'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:164:in `block (2 levels) in build_extension'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:163:in `chdir'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:163:in `block in build_extension'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:162:in `synchronize'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:162:in `build_extension'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:201:in `block in build_extensions'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:198:in `each'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:198:in `build_extensions'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:752:in `build_extensions'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:304:in `install'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/resolver/specification.rb:97:in `install'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:166:in `block in install'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:156:in `each'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:156:in `install'
C:/Ruby231-x64/lib/ruby/site_ruby/2.3.0/rubygems/dependency_installer.rb:405:in `install'
mkrf_conf.rb:35:in `rescue in <main>'
mkrf_conf.rb:28:in `<main>'
rake failed, exit code 1
Gem files will remain installed in C:/Ruby231-x64/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.0 for inspection.
Results logged to C:/Ruby231-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/ruby-debug-ide-0.6.0/gem_make.out
$ gem install debase-ruby_core_source
Successfully installed debase-ruby_core_source-0.9.6
$ gem install debase -- --with-ruby-include=C:\Ruby231-x64\lib\ruby\gems\2.3.0\gems\debase-ruby_core_source-0.9.6\lib\debase\ruby_core_source\ruby-2.3.1-p112
Building native extensions with: '--with-ruby-include=C:\Ruby231-x64\lib\ruby\gems\2.3.0\gems\debase-ruby_core_source-0.9.6\lib\debase\ruby_core_source\ruby-2.3.1-p112ruby -v'
This could take a while...
System cannot find path specified
ERROR: Error installing debase:
ERROR: Failed to build gem native extension.
$ gem install debase --pre
Building native extensions. This could take a while...
System cannot find path specified
ERROR: Error installing debase:
ERROR: Failed to build gem native extension.
$ gem install ruby-debug-ide --pre
Building native extensions. This could take a while...
Системе не удается найти указанный путь.
ERROR: Error installing ruby-debug-ide:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.1.beta4/ext
C:/Ruby231-x64_unit/bin/ruby.exe mkrf_conf.rb
'Ёбв?┐? -? г¤ ?вбп - cвЁ гЄ § --лc Їгвм.
'Ёбв?┐? -? г¤ ?вбп - cвЁ гЄ § --лc Їгвм.
Installing base gem
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Failed to build gem native extension.
current directory: C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/gems/debase-0.2.2.beta9/ext
C:/Ruby231-x64_unit/bin/ruby.exe -r ./siteconf20170201-7760-7dws4t.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/debase-0.2.2.beta9/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/gems/debase-0.2.2.beta9 for inspection.
Results logged to C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/debase-0.2.2.beta9/gem_make.out
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:91:in `run'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/ext_conf_builder.rb:36:in `block in build'
C:/Ruby231-x64_unit/lib/ruby/2.3.0/tempfile.rb:295:in `open'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/ext_conf_builder.rb:19:in `build'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:163:in `block (2 levels) in build_extension'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:162:in `chdir'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:162:in `block in build_extension'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:161:in `synchronize'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:161:in `build_extension'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:200:in `block in build_extensions'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:197:in `each'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/ext/builder.rb:197:in `build_extensions'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:741:in `build_extensions'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:290:in `install'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:166:in `block in install'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:150:in `each'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/request_set.rb:150:in `install'
C:/Ruby231-x64_unit/lib/ruby/site_ruby/2.3.0/rubygems/dependency_installer.rb:404:in `install'
mkrf_conf.rb:35:in `rescue in <main>'
mkrf_conf.rb:28:in `<main>'
rake failed, exit code 1
Gem files will remain installed in C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.1.beta4 for inspection.
Results logged to C:/Ruby231-x64_unit/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/ruby-debug-ide-0.6.1.beta4/gem_make.out
I recently tried to install rest-client on Ruby, in order to follow along with a tutorial, and I get the error that I will post down below. I've successfully installed DevKit. When I input gem -v, command prompt returns 2.2.5. The entirety of the error is down below.
Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/unf-0.2.0.
beta2/ext/gems/gems/unf_ext-0.0.7.1 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/gems/unf-0.2.0.beta2/ext/gems/ex
tensions/x86-mingw32/2.1.0/unf_ext-0.0.7.1/gem_make.out
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:38:in `bl
ock in build'
from C:/Ruby21/lib/ruby/2.1.0/tempfile.rb:324:in `open'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `bu
ild'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 l
evels) in build_extension'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in b
uild_extension'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchroniz
e'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_exte
nsion'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in b
uild_extensions'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_exte
nsions'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/installer.rb:677:in `build_extens
ions'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/installer.rb:232:in `install'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/resolver/specification.rb:78:in `
install'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/request_set.rb:206:in `block in i
nstall_into'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/request_set.rb:198:in `each'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/request_set.rb:198:in `install_in
to'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/request_set.rb:119:in `install'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/dependency_installer.rb:389:in `i
nstall'
from mkrf_conf.rb:15:in `<main>'
Building native extensions. This could take a while...
rake failed, exit code 1
Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/unf-0.2.0.
beta2 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/unf
-0.2.0.beta2/gem_make.out
I'm in Ubuntu 14.04 using ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
I type irb and suddenly I get the following
/usr/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/nokogiri-1.6.2.1 (Errno::EACCES)
from /usr/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
from /usr/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `each'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:210:in `write_gem_make_out'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:132:in `build_error'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:171:in `rescue in build_extension'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:156:in `build_extension'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:195:in `each'
from /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:195:in `build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:1436:in `block in build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/user_interaction.rb:45:in `use_ui'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:1434:in `build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/stub_specification.rb:60:in `build_extensions'
from /usr/local/lib/site_ruby/1.9.1/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:925:in `block in find_inactive_by_path'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:924:in `each'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:924:in `find'
from /usr/local/lib/site_ruby/1.9.1/rubygems/specification.rb:924:in `find_inactive_by_path'
from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:185:in `try_activate'
from /usr/lib/ruby/1.9.1/irb/locale.rb:150:in `block in search_file'
from /usr/lib/ruby/1.9.1/irb/locale.rb:158:in `block in each_localized_path'
from /usr/lib/ruby/1.9.1/irb/locale.rb:167:in `each_sublocale'
from /usr/lib/ruby/1.9.1/irb/locale.rb:157:in `each_localized_path'
from /usr/lib/ruby/1.9.1/irb/locale.rb:145:in `search_file'
from /usr/lib/ruby/1.9.1/irb/locale.rb:124:in `find'
from /usr/lib/ruby/1.9.1/irb/locale.rb:108:in `load'
from /usr/lib/ruby/1.9.1/irb/locale.rb:32:in `initialize'
from /usr/lib/ruby/1.9.1/irb/init.rb:114:in `new'
from /usr/lib/ruby/1.9.1/irb/init.rb:114:in `init_config'
from /usr/lib/ruby/1.9.1/irb/init.rb:16:in `setup'
from /usr/lib/ruby/1.9.1/irb.rb:53:in `start'
from /usr/bin/irb:12:in `<main>'
So here's the /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/ folder listing:
bcrypt-3.1.7 ffi-1.9.3 nokogiri-1.6.3.rc1 therubyracer-0.12.1
binding_of_caller-0.7.2 json-1.8.1 pg-0.17.1 unicorn-4.8.3
debug_inspector-0.0.2 kgio-2.9.2 raindrops-0.13.0
As you can see I already have nokogiri-1.6.3.rc1, but irb, without my asking, is trying to build nokogiri-1.6.2.1. I then add print statements to both /usr/lib/ruby/1.9.1/fileutils.rb:247:in 'fu_mkdir' and /usr/local/lib/site_ruby/1.9.1/rubygems/ext/builder.rb:210:in 'write_gem_make_out' to see what they're trying to do. I change ownership recursively to the current user for /var/lib/gems/. I then run irb and get the following.
Dir.mkdir /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/nokogiri-1.6.2.1
Building nokogiri using packaged libraries.
Building libxml2-2.8.0 for nokogiri.
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxml2.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
However, note that nokogiri does not necessarily support all versions
of libxml2.
For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.
************************************************************************
Building libxslt-1.1.28 for nokogiri.
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxslt.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
************************************************************************
Dir.mkdir /var/lib/gems/1.9.1/gems/nokogiri-1.6.2.1/lib
FileUtils.mkdir_p /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/nokogiri-1.6.2.1
Dir.mkdir /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/nokogiri-1.6.2.1
I didn't ask for Nokogiri to build. At the moment I could care less about it. Why did it build Nokogiri without my asking? And why would irb stop me from continuing my work to do so?
irb works now. The /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/ folder now looks like
bcrypt-3.1.7 ffi-1.9.3 nokogiri-1.6.2.1 raindrops-0.13.0
binding_of_caller-0.7.2 json-1.8.1 nokogiri-1.6.3.rc1 therubyracer-0.12.1
debug_inspector-0.0.2 kgio-2.9.2 pg-0.17.1 unicorn-4.8.3
So now I have two versions of nokogiri. "Stop it irb! You're drunk!" In case you're wondering I had just now booted up my computer. Previously I had had an application build a customized Nokogiri instance. But I still don't know why this happened.
-----> Ruby/Rack app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.0.pre.2
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
^[[C^[[D^[[D/app/slug-compiler/lib/utils.rb:66:in `block (2 levels) in spawn': command='/app/slug-compiler/lib/../../tmp/buildpacks/ruby/bin/compile /tmp/build_22uiq5k0q45sp /app/tmp/repo.git/.cache' exit_status=0 out='' at=timeout elapsed=900.1076555252075 (Utils::TimeoutError)
from /app/slug-compiler/lib/utils.rb:52:in `loop'
from /app/slug-compiler/lib/utils.rb:52:in `block in spawn'
from /app/slug-compiler/lib/utils.rb:47:in `popen'
from /app/slug-compiler/lib/utils.rb:47:in `spawn'
from /app/slug-compiler/lib/buildpack.rb:37:in `block in compile'
from /app/slug-compiler/lib/buildpack.rb:35:in `fork'
from /app/slug-compiler/lib/buildpack.rb:35:in `compile'
from /app/slug-compiler/lib/slug.rb:497:in `block in run_buildpack'
from /app/slug-compiler/lib/utils.rb:121:in `log'
from /app/slug-compiler/lib/slug.rb:748:in `log'
from /app/slug-compiler/lib/slug.rb:496:in `run_buildpack'
from /app/slug-compiler/lib/slug.rb:125:in `block (2 levels) in compile'
from /app/slug-compiler/lib/utils.rb:102:in `block in timeout'
from /usr/local/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
from /app/slug-compiler/lib/utils.rb:102:in `rescue in timeout'
from /app/slug-compiler/lib/utils.rb:97:in `timeout'
from /app/slug-compiler/lib/slug.rb:114:in `block in compile'
from /app/slug-compiler/lib/utils.rb:121:in `log'
from /app/slug-compiler/lib/slug.rb:748:in `log'
from /app/slug-compiler/lib/slug.rb:113:in `compile'
from /app/slug-compiler/bin/slugc:85:in `block in '
from /app/slug-compiler/lib/slug.rb:505:in `block in lock'
from /app/slug-compiler/lib/repo_lock.rb:44:in `call'
from /app/slug-compiler/lib/repo_lock.rb:44:in `run'
from /app/slug-compiler/lib/slug.rb:505:in `lock'
from /app/slug-compiler/bin/slugc:66:in `'
! Heroku push rejected, failed to compile Ruby/rack app
Here is my Gemfile:
source :rubygems
ruby '1.9.3'
gem 'sinatra', '1.3.3'
gem 'sinatra-contrib', '1.3.2'
gem 'thin', '1.5.0'
gem 'haml', '3.1.6'
gem 'bcrypt-ruby', '3.0.1'
gem 'mongo', '1.8.0'
gem 'bson_ext', '1.8.0'
gem 'mongoid', '3.0.16'
gem 'sinatra-flash', '0.3.0'
gem 'braintree', '2.22.0'
gem 'faye', '0.8.6'
#gem 'pony'
The error is gone when I change
gem 'braintree', '2.22.0'
to
gem 'braintree'
UPDATE: This answer doesn't work. The only option is to raise a support ticket.
There's a new feature that fixes this problem:
$ heroku config:set COMPILE_TIMEOUT=n
where n is a number in seconds. I used n=3000 (default is 900).
(note: you may need user-env-compile enabled to use this feature)
Update: Please read the comments on this answer for updated information!
For me the solution that I found was:
Push first half of my dependencies (half of the requirements.txt file)
Push all the requirements.txt file (including opencv dependency), this work because heroku keep in cached the first half, so then the second installation will go more fast