我正在安装Redmine,因为rake问题我变得疯狂了。特别是,为了对不同的Ruby插件执行bundle安装,我被要求安装xapian-full-alaveteli,v 1.2.9.5。 问题是我收到以下错误:
Building native extensions. This could take a while...
ERROR: Error installing xapian-full-alaveteli:
ERROR: Failed to build gem native extension.
/home/redmine/.rvm/rubies/ruby-2.2.0/bin/ruby -rubygems /home/redmine/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake RUBYARCHDIR=/home/redmine/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/xapian-full-alaveteli-1.2.9.5 RUBYLIBDIR=/home/redmine/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/xapian-full-alaveteli-1.2.9.5
rake aborted!
NameError: uninitialized constant Config
/home/redmine/.rvm/gems/ruby-2.2.0/gems/xapian-full-alaveteli-1.2.9.5/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in /home/redmine/.rvm/gems/ruby-2.2.0/gems/xapian-full-alaveteli-1.2.9.5 for inspection.
Results logged to /home/redmine/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/xapian-full-alaveteli-1.2.9.5/gem_make.out
我尝试手动编辑rakefile并删除导致麻烦的行,但它神奇地重新出现。关于使用rake / gem的文档,imho,至少是模糊的,因此我完全陷入困境 - 两天前应该投入生产的服务器......
答案 0 :(得分:3)
对Config的过时调用可能导致错误。尝试更改
Config::CONFIG ====> RbConfig::CONFIG
运行Gem的rakefile导致错误:未初始化的常量配置。
谷歌搜索建议Config is obsolete and to replace it with RbConfig. RbConfig位于最新的Ruby though the document is blank和I cannot find a Config in Ruby中。
修复使用RbConfig替换Config:gettalong/kramdown和thoughtbot/cocaine。这也适用于我的情况。
将Config::CONFIG
替换为RbConfig::CONFIG