Ruby on rails 日期性能安装错误

Ruby on rails 日期性能安装错误,ruby-on-rails,ruby,Ruby On Rails,Ruby,当我尝试使用命令gem install date performance安装gem时,出现以下错误: date_performance.c:16:14: erro: static declaration of ‘rb_cRational’ follows non-static declaration ... date_performance.c:365:3: aviso: ISO C90 forbids mixed declarations and code [-pedantic] make:

当我尝试使用命令
gem install date performance
安装gem时,出现以下错误:

date_performance.c:16:14: erro: static declaration of ‘rb_cRational’ follows non-static declaration
...
date_performance.c:365:3: aviso: ISO C90 forbids mixed declarations and code [-pedantic]
make: ** [date_performance.o] Erro 1
如何修复它

Udpate:

Ubuntu也是如此,我使用ruby 1.9

遵循完整错误:

/home/vmlellis/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
creating Makefile

make
compiling date_performance.c
date_performance.c:16:14: erro: static declaration of ‘rb_cRational’ follows non-static declaration
In file included from /home/vmlellis/.rvm/rubies/ruby-1.9.3-p392/include/ruby-1.9.1/ruby.h:32:0,
                 from date_performance.c:9:
/home/vmlellis/.rvm/rubies/ruby-1.9.3-p392/include/ruby-1.9.1/ruby/ruby.h:1271:19: nota: previous declaration of ‘rb_cRational’ was here
date_performance.c: Na função ‘rb_date_new’:
date_performance.c:200:5: aviso: ISO C90 forbids mixed declarations and code [-pedantic]
date_performance.c:219:3: aviso: ISO C90 forbids mixed declarations and code [-pedantic]
date_performance.c: Na função ‘rb_date_strftime’:
date_performance.c:253:31: erro: ‘struct RString’ has no member named ‘ptr’
date_performance.c:254:29: erro: ‘struct RArray’ has no member named ‘ptr’
date_performance.c:268:30: erro: ‘struct RString’ has no member named ‘ptr’
date_performance.c:269:17: erro: ‘struct RString’ has no member named ‘len’
date_performance.c:277:30: erro: ‘struct RString’ has no member named ‘ptr’
date_performance.c:279:5: aviso: implicit declaration of function ‘bzero’ [-Wimplicit-function-declaration]
date_performance.c:279:5: aviso: incompatible implicit declaration of built-in function ‘bzero’ [habilitado por padrão]
date_performance.c:284:23: erro: ‘struct RString’ has no member named ‘len’
date_performance.c: Na função ‘rb_date_strptime’:
date_performance.c:304:27: erro: ‘struct RString’ has no member named ‘ptr’
date_performance.c:305:27: erro: ‘struct RString’ has no member named ‘ptr’
date_performance.c:329:3: aviso: implicit declaration of function ‘strptime’ [-Wimplicit-function-declaration]
date_performance.c: Na função ‘rb_date_compare’:
date_performance.c:350:3: aviso: ISO C90 forbids mixed declarations and code [-pedantic]
date_performance.c:353:5: aviso: comentários usando o estilo do C++ não são permitidos na ISO C90 [habilitado por padrão]
date_performance.c:353:5: aviso: (isso será relatado apenas uma vez por aquivo de entrada) [habilitado por padrão]
date_performance.c:365:3: aviso: ISO C90 forbids mixed declarations and code [-pedantic]
make: ** [date_performance.o] Erro 1

这颗宝石是针对Ruby 1.8的:

这个软件包为Ruby 1.8的核心增加了一些性能的外观 使用不同技术组合的日期类

它可能在Ruby 1.9+中被打破(Ruby并不以其向前兼容性而闻名),在GitHub项目页面上,您可以看到它在过去4年中一直没有更新


在你的Ruby 1.9 Ubuntu安装上它不起作用。

这个gem是针对Ruby 1.8的:

这个软件包为Ruby 1.8的核心增加了一些性能的外观 使用不同技术组合的日期类

它可能在Ruby 1.9+中被打破(Ruby并不以其向前兼容性而闻名),在GitHub项目页面上,您可以看到它在过去4年中一直没有更新


在您的Ruby 1.9 Ubuntu安装中,它无法工作。

请粘贴完整错误。另外,您正在运行什么操作系统?看起来
rb_cRational
定义了两次,这可能是一个bug。我认为这只是ruby 1.8的问题。。。我认为在ruby 1.9上Date的性能有了改进。请粘贴完整的错误。另外,您正在运行什么操作系统?看起来
rb_cRational
定义了两次,这可能是一个bug。我认为这只是ruby 1.8的问题。。。我认为在ruby 1.9上Date的性能有了改进。同样重要的是,ruby 1.9.3(如果不是更早的话)在C中重新实现了Date作为标准库的一部分。同样重要的是,ruby 1.9.3(如果不是更早的话)在C中重新实现了Date作为标准库的一部分。