【发布时间】:2011-07-20 12:11:41
【问题描述】:
我正在努力安装 RedCloth gem。当我输入
gem install RedCloth
我明白了:
[…]
ragel/redcloth_attributes.c.rl: In function ‘redcloth_attribute_parser’:
ragel/redcloth_attributes.c.rl:26:11: error: variable ‘act’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make: *** [redcloth_attributes.o] Error 1
[…]
原因是 RedCloth gem 的 extconf.rb 中传递给 gcc 的 -Werror 编译选项:
require 'mkmf'
CONFIG['warnflags'].gsub!(/-Wshorten-64-to-32/, '') if CONFIG['warnflags']
$CFLAGS << ' -O0 -Wall -Werror' if CONFIG['CC'] =~ /gcc/
[…]
问题是当我从文件中删除 -Werror 选项时,它会在我下次启动“gem install”命令时自动重新出现。
如何永久取消设置 -Werror 选项?
另一个选择是降级到 gcc 4.5.2,但它不在我的 Fedora 15 的存储库中。
而且我宁愿避免从源代码编译它……
非常感谢任何帮助。
【问题讨论】:
标签: ruby-on-rails gcc gem