Ruby on rails 为什么可以';t heroku使用ruby 1.9.2在竹堆上安装nokogiri 1.6.5?

Ruby on rails 为什么可以';t heroku使用ruby 1.9.2在竹堆上安装nokogiri 1.6.5?,ruby-on-rails,heroku,Ruby On Rails,Heroku,在我的笔记本电脑上,我的ruby版本是: $ ruby -version ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin14.0.0] 我的rails版本是: $ ./bin/rails -v Rails 3.2.15 我的Gemfile有一个对nokogiri的未版本引用: $ grep nokogiri Gemfile gem "nokogiri" 但是我的Gemfile.lock显示: nokogiri (1.6.5

在我的笔记本电脑上,我的ruby版本是:

$ ruby -version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin14.0.0]
我的rails版本是:

$ ./bin/rails -v
Rails 3.2.15
我的Gemfile有一个对nokogiri的未版本引用:

$ grep nokogiri Gemfile
gem "nokogiri"
但是我的Gemfile.lock显示:

nokogiri (1.6.5)
  mini_portile (~> 0.6.0)
我在传统竹堆上:

$ heroku info | grep -i stack
Stack:         bamboo-mri-1.9.2
当我推送到heroku时(使用git ssh传输):

当到达nokogiri附属地时,部署炸弹:

   ...
   Installing nokogiri (1.6.5) with native extensions /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

   /usr/ruby1.9.2/bin/ruby extconf.rb 
   *** 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=/usr/ruby1.9.2/bin/ruby
    --help
    --clean
   /usr/ruby1.9.2/lib/ruby/1.9.1/mkmf.rb:445:in `try_compile': wrong number of arguments (3 for 2) (ArgumentError)
    from extconf.rb:77:in `block in add_cflags'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/mkmf.rb:481:in `with_cflags'
    from extconf.rb:76:in `add_cflags'
    from extconf.rb:323:in `<main>'
   checking if the C compiler accepts ... 

   Gem files will remain installed in /tmp/build_8908ccf0104d2f6073466c3fe2186d76/.bundle/gems/ruby/1.9.1/gems/nokogiri-1.6.5 for inspection.
   Results logged to /tmp/build_8908ccf0104d2f6073466c3fe2186d76/.bundle/gems/ruby/1.9.1/gems/nokogiri-1.6.5/ext/nokogiri/gem_make.out
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `block in run'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `block in each'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13:in `<top (required)>'
    from /usr/ruby1.9.2/bin/bundle:19:in `load'
    from /usr/ruby1.9.2/bin/bundle:19:in `<main>'
   FAILED: http://devcenter.heroku.com/articles/bundler

!     Push failed: failed to install gems via Bundler
!     If the problem persists, see http://help.heroku.com and provide Request ID 6f60ac09-059f-4a33-b913-02e32e2f34e4.
。。。
使用本机扩展安装nokogiri(1.6.5)/usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:483:“build_extensions中的rescue in block”:错误:无法构建gem本机扩展。(Gem::Installer::ExtensionBuildError)
/usr/ruby1.9.2/bin/ruby extconf.rb
***extconf.rb失败***
由于某些原因无法创建Makefile,可能是缺少
必要的库和/或标题。查看mkmf.log文件了解更多信息
细节。您可能需要配置选项。
提供的配置选项:
--使用opt dir
--不带opt dir
--选择包含
--不带opt include=${opt dir}/include
--使用opt lib
--不带opt lib=${opt dir}/lib
--用make prog
--没有make prog
--srcdir=。
--库尔迪尔
--ruby=/usr/ruby1.9.2/bin/ruby
--帮助
--干净的
/usr/ruby1.9.2/lib/ruby/1.9.1/mkmf.rb:445:in'try_compile':参数数量错误(3代表2)(ArgumentError)
来自extconf.rb:77:in`block in add_cflags'
from/usr/ruby1.9.2/lib/ruby/1.9.1/mkmf.rb:481:in'with_cflags'
摘自extconf.rb:76:in`add_cflags'
来自extconf.rb:323:in`'
正在检查C编译器是否接受。。。
Gem文件将继续安装在/tmp/build8908CCF0104D2F6073466C3FE2186D76/.bundle/gems/ruby/1.9.1/gems/nokogiri-1.6.5中以供检查。
结果记录到/tmp/build_8908ccf0104d2f6073466c3fe2186d76/.bundle/gems/ruby/1.9.1/gems/nokogiri-1.6.5/ext/nokogiri/gem_make.out
from/usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:486:in'block in build_extensions'
from/usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in'each'
from/usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in'build_extensions'
from/usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:198:in'install'
来自/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/source.rb:95:in'install'
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:55:在“运行中的块”中
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in`block in each'
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in'each'
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in'each'
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:44:在“运行”中
来自/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in'install'
从/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/cli.rb:225:“安装”中
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:处于“运行”状态
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in“invoke_task”
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in“dispatch”
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in'start'
from/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13:in`'
from/usr/ruby1.9.2/bin/bundle:19:in‘load’
from/usr/ruby1.9.2/bin/bundle:19:in`'
失败:http://devcenter.heroku.com/articles/bundler
!     推送失败:无法通过绑定器安装gems
!     如果问题仍然存在,请参阅http://help.heroku.com 并提供请求ID 6f60ac09-059f-4a33-b913-02e32e2f34e4。

你知道如何解决这个问题吗?

nokogiri 1.6.5是最新版本。新版本的nokogiri可能不支持安装在竹堆中的nokogiri依赖项和C库。别忘了这堆竹子已经有4年的历史了

你是在假装一个不到一个月前发布的库与4年前发布的C库进行编译。
错误的参数数
错误可能是由于nokogiri所需的一个C库的公共方法签名发生了更改。nokogiri希望该方法接受3个参数,而旧版本的C库只接受2个参数

您可以尝试将nokogiri需求降级为旧版本

gem 'nokogiri', '~> 1.4.0'
事实上,最好的解决方案是升级到Cedar stack。在任何情况下,你最终都需要,竹堆将在几个月后退役,你的应用程序将在任何情况下停止工作

gem 'nokogiri', '~> 1.4.0'