2017-02-27 1 views
5

noob ici, j'essaie d'installer octopress mais quand je cours rbenv exec bundle install j'ai eu cette erreur.Erreur pour regrouper installer "yajl-ruby"

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 
current directory: 
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl 
/home/idiot/.rbenv/versions/2.4.0/bin/ruby -r ./siteconf20170227-4161-uizrqn.rb extconf.rb 
creating Makefile 

current directory: 
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl 
make "DESTDIR=" clean 

current directory: 
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby-1.2.1/ext/yajl 
make "DESTDIR=" 
compiling yajl.c 
compiling yajl_alloc.c 
compiling yajl_buf.c 
compiling yajl_encode.c 
compiling yajl_ext.c 
yajl_ext.c: In function ‘rb_yajl_parser_parse’: 
yajl_ext.c:471:17: warning: variable ‘stat’ set but not used [Wunused-but-set-variable] 
yajl_status stat; 
      ^~~~ 
yajl_ext.c: In function ‘rb_yajl_encoder_enable_json_gem_ext’: 
yajl_ext.c:881:22: error: ‘rb_cFixnum’ undeclared (first use in this function) 
rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1); 
        ^~~~~~~~~~ 
yajl_ext.c:881:22: note: each undeclared identifier is reported only once for each 
function it appears in 
yajl_ext.c: At top level: 
cc1: warning: unrecognized command line option ‘-Wno-self-assign’ 
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ 
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ 
make: *** [Makefile:242: yajl_ext.o] Error 1 

make failed, exit code 2 

Gem files will remain installed in 
/home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/yajl-ruby1.2.1 for inspection. 
Results logged to 
    /home/idiot/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/yajl-ruby-1.2.1/gem_make.out 

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

J'ai essayé de googler, mais encore ne l'ai pas trouvé une solution à ce problème, quelqu'un répondre à ma question, je suis très reconnaissant.

Répondre

13

L'extension native n'a pas encore été mise à jour pour Ruby 2.4. Le changement de rupture est que Fixnum et Bignum (rb_cFixnum et rb_cBignum dans l'API C) ont été unifiés au Integer (rb_cInteger).

Vérifiez le référentiel yajl-ruby pour une question/pull request fixant la compatibilité Ruby 2.4 ou utilisez Ruby 2.3.3 pour le moment.

+0

Merci pour vos explications et suggestions @michael. –

+0

S'il vous plaît noter qu'il est de coutume sur SO de upvote/accepter les réponses qui vous ont aidé. C'est ainsi que d'autres savent que votre problème a été résolu. –

+0

Merci mon pote, j'ai résolu ce problème –