1

When I try install the gem date-performance with command gem install date-performance, I get this error:

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

How to fix it?

Udpate:

The SO is Ubuntu and I use ruby 1.9

Follows the full error:

/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
4

1 に答える 1

1

この gem は Ruby 1.8 を対象としています。

このパッケージは、さまざまな手法の組み合わせを使用して、Ruby 1.8 のコア Date クラスに類似したパフォーマンスを追加します。

これはおそらく Ruby 1.9+ で機能しなくなり (Ruby は上位互換性で知られていません..)、GitHub プロジェクト ページで、過去 4 年間更新されていないことがわかります。

Ruby 1.9 Ubuntu インストールでは機能しません。

于 2013-05-17T17:56:58.240 に答える