【问题标题】:Failed to build gem native extension ruby 2.0 upgrade fastthread构建gem原生扩展ruby 2.0升级fastthread失败
【发布时间】:2013-02-25 21:32:01
【问题描述】:

我正在将我的系统升级到 ruby​​ 2.0,并且我已经完成了所有工作,除了将我的电脑扔到墙上。我很难相信 fastthread 是问题所在。运行“捆绑安装”时是否有其他人看到此错误。这是我的红宝石版本

红宝石-v ruby 2.0.0p0(2013-02-24 修订版 39474)[x86_64-darwin12.2.0]

当我尝试运行 rails -v 我得到了这个

导轨-v 在任何来源中都找不到 fastthread-1.0.7 运行 bundle install 来安装缺失的 gem。

Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.0.3) 
Using i18n (0.6.1) 
Using multi_json (1.6.1) 
Using activesupport (3.2.9) 
Using builder (3.0.4) 
Using activemodel (3.2.9) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.2.2) 
Using actionpack (3.2.9) 
Using mime-types (1.21) 
Using polyglot (0.3.3) 
Using treetop (1.4.12) 
Using mail (2.4.4) 
Using actionmailer (3.2.9) 
Using arel (3.0.2) 
Using tzinfo (0.3.35) 
Using activerecord (3.2.9) 
Using activeresource (3.2.9) 
Using bundler (1.3.0) 
Using highline (1.6.15) 
Using net-ssh (2.6.5) 
Using net-scp (1.1.0) 
Using net-sftp (2.1.1) 
Using net-ssh-gateway (1.2.0) 
Using capistrano (2.14.2) 
Using chunky_png (1.2.7) 
Using coffee-script-source (1.5.0) 
Using execjs (1.4.0) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.3) 
Using json (1.7.7) 
Using rdoc (3.12.2) 
Using thor (0.17.0) 
Using railties (3.2.9) 
Using coffee-rails (3.2.2) 
Using fssm (0.2.10) 
Using sass (3.2.6) 
Using compass (0.12.2) 
Using compass-rails (1.0.3) 
Using daemon_controller (1.1.1) 
Installing fastthread (1.0.7) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/ben/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb 
extconf.rb:13:in `block in <main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:13:in `block in <main>': Use RbConfig instead of obsolete and deprecated Config.

make
Makefile:104: *** missing separator.  Stop.


Gem files will remain installed in /Users/[me]/.rvm/gems/ruby-2.0.0-p0/gems/fastthread-1.0.7 for inspection.
Results logged to /Users/[me]/.rvm/gems/ruby-2.0.0-p0/gems/fastthread-1.0.7/ext/fastthread/gem_make.out

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

还有其他人遇到过这种情况吗?

/Users/[me]/.rvm/gems/ruby-2.0.0-p0/gems/fastthread-1.0.7/ext/fastthread/gem_mak‌​e.out 的内容

/Users/[me]/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb

extconf.rb:13:in `block in <main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:13:in `block in <main>': Use RbConfig instead of obsolete and deprecated   Config.

make
Makefile:104: *** missing separator.  Stop.

【问题讨论】:

  • 那么 /Users/[me]/.rvm/gems/ruby-2.0.0-p0/gems/fastthread-1.0.7/ext/fastthread/gem_make.out 是什么样的?
  • 感谢您查看 Casper,我已使用该 gem_make.out 文件的内容更新了主题。我还检查了 ruby​​ extconf.rb 文件,它是随机字符。
  • 那是一颗非常古老的宝石。你确定你需要它吗?我不认为你这样做(?)我会从依赖项中删除它并重试。
  • 是的,我绝对没有,但它在 gemfile.lock 中,我删除了该文件,因为它导致我出错。也许我只需要再次添加该文件并再次捆绑它。
  • 不,这行不通。据我所知,Ruby 2.0 不推荐使用 Config。您必须升级您的依赖项或提交关于需要快速线程作为依赖项的 gem 的错误报告。

标签: ruby ruby-on-rails-3 ruby-2.0


【解决方案1】:

Phusion Passenger 4 已经通过移除 fastthread 依赖解决了这个问题。 4.0 beta 和 RC 在 Ruby 2.0 上安装得很好。

【讨论】:

  • 没错。只需安装最新版本的 Passenger (gem install passenger -v 4.0.0.rc4)。
  • 对于在 Snow Leopard 上运行的任何人,适用的最高乘客版本是 4.0.5
【解决方案2】:

如果您使用Passenger 作为您的网络服务器,您必须 拥有这种依赖关系。请参阅此拉取请求以进行修复:https://github.com/zoltankiss/fastthread/commit/a47a121990cf7d4f31147406c2d379dabc048479

gem 的作者尚未包含此修复程序。如果需要,您可以从 https://github.com/zoltankiss/fastthread 要求 fastthread。那是提交拉取请求的人。

【讨论】:

  • 你确定吗?我认为 Ruby >= 1.9 不再需要它,即使使用Passenger。请在此处查看此博客文章:blog.phusion.nl/2009/02/02/getting-ready-for-ruby-191,以及此 github 问题:github.com/mental/fastthread/issues/2。我不使用乘客,所以我可能是错的,但博客文章确实说 fastthread 在 Ruby 1.9 中是无操作的..
  • 非常感谢您。这就是问题所在。我删除了乘客 gem(显然这是造成依赖问题的那个),现在我可以让一切正常工作了。现在我知道如何解决它了!谢谢 Casper 和 LRH!
  • @Casper 我很确定。 rubygems.org/gems/passenger 乘客 gem 仍然将 fastthread 列为运行时依赖项。无论它是否是空操作,它都必须正确编译才能安装乘客。
  • @LRH - 好的,谢谢。很高兴知道。无论如何,该修复程序很容易应用。
  • 此 gem 的作者似乎处于非活动状态。我们可能必须创建一个分支并自己应用拉取请求并通知乘客指向新的。
猜你喜欢
  • 1970-01-01
  • 2012-03-22
  • 1970-01-01
  • 1970-01-01
  • 2011-05-27
  • 2010-09-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多