色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁技術文章
文章詳情頁

mysql - 安裝gem報錯

瀏覽:90日期:2022-06-15 13:29:58

問題描述

1.相應的環境:  ubuntu12.04 ruby 2.4 2.通過 

bundle install --deployment --without development test postgres aws

安裝gem的時候報錯:

 

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:/home/git/gitlab/vendor/bundle/ruby/2.4.0/gems/json-1.8.1/ext/json/ext/generator/usr/local/bin/ruby -r ./siteconf20170122-2448-oz1rn0.rb extconf.rbcreating Makefile

current directory:/home/git/gitlab/vendor/bundle/ruby/2.4.0/gems/json-1.8.1/ext/json/ext/generatormake 'DESTDIR=' clean

current directory:/home/git/gitlab/vendor/bundle/ruby/2.4.0/gems/json-1.8.1/ext/json/ext/generatormake 'DESTDIR=' compiling generator.c In file included fromgenerator.c:1:0: ../fbuffer/fbuffer.h: In function ’fbuffer_to_s’:../fbuffer/fbuffer.h:175:47: error: macro 'rb_str_new' requires 2arguments, but only 1 given ../fbuffer/fbuffer.h:175:20: warning:initialization makes integer from pointer without a cast [enabled bydefault] generator.c: In function ’generate_json’: generator.c:840:25:error: ’rb_cFixnum’ undeclared (first use in this function)generator.c:840:25: note: each undeclared identifier is reported onlyonce for each function it appears in generator.c:842:25: error:’rb_cBignum’ undeclared (first use in this function) generator.c: Attop level: cc1: warning: unrecognized command line option'-Wno-self-assign' [enabled by default] cc1: warning: unrecognizedcommand line option '-Wno-constant-logical-operand' [enabled bydefault] cc1: warning: unrecognized command line option'-Wno-parentheses-equality' [enabled by default] cc1: warning:unrecognized command line option '-Wno-tautological-compare' [enabledby default] make: * [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in/home/git/gitlab/vendor/bundle/ruby/2.4.0/gems/json-1.8.1 for

Results logged to/home/git/gitlab/vendor/bundle/ruby/2.4.0/extensions/x86-linux/2.4.0-static/json-1.8.1/gem_make.out

An error occurred while installing json (1.8.1), and Bundler cannot

Make sure that gem install json -v ’1.8.1’ succeeds before bundling.

但是看到Make sure that gem install json -v ’1.8.1’ succeeds before bundling.

于是我就手動安裝了gem install json -v ’1.8.1’ ,依然報錯:

Building native extensions. This could take a while...ERROR: Error installing json: ERROR: Failed to build gem native extension. current directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.1/ext/json/ext/generator/usr/local/bin/ruby -r ./siteconf20170122-3475-aueo31.rb extconf.rbcreating Makefilecurrent directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.1/ext/json/ext/generatormake 'DESTDIR=' cleancurrent directory: /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.1/ext/json/ext/generatormake 'DESTDIR='compiling generator.cIn file included from generator.c:1:0:../fbuffer/fbuffer.h: In function ’fbuffer_to_s’:../fbuffer/fbuffer.h:175:47: error: macro 'rb_str_new' requires 2 arguments, but only 1 given../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer without a cast [enabled by default]generator.c: In function ’generate_json’:generator.c:840:25: error: ’rb_cFixnum’ undeclared (first use in this function)generator.c:840:25: note: each undeclared identifier is reported only once for each function it appears ingenerator.c:842:25: error: ’rb_cBignum’ undeclared (first use in this function)generator.c: At top level:cc1: warning: unrecognized command line option '-Wno-self-assign' [enabled by default]cc1: warning: unrecognized command line option '-Wno-constant-logical-operand' [enabled by default]cc1: warning: unrecognized command line option '-Wno-parentheses-equality' [enabled by default]cc1: warning: unrecognized command line option '-Wno-tautological-compare' [enabled by default]make: *** [generator.o] Error 1make failed, exit code 2Gem files will remain installed in /usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.1 for inspection.Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86-linux/2.4.0-static/json-1.8.1/gem_make.out

本人并不太了解ruby,gem,我只是安裝依賴ruby的軟件時候遇到的。請哪位大神幫忙看一下,該問題應該怎么解決?還有講講ruby , gem , ruby-rails,bundle之間的關系!謝謝!

問題解答

回答1:

json-1.8.1 與 ruby-2.4.0 不兼容,想要順利安裝,可以嘗試一下下面兩個辦法:

降低 Ruby 的版本。查了一下,1.8.1 已經很老了,與 2.2.x 版本不兼容,需要降到 2.1.x 版本。

升級 json 到 1.8.5 版本。執行 bundle update json,然后 bundle install。因為不知道你的 Gemfile 是怎么寫的,無法確定有沒有明確依賴 1.8.1 版本。所以這個方法不一定成功。

Ruby 是語言。gem 是一組 Ruby 程序,類似于「包」的概念。RubyGems 是 Ruby 的包管理器,用來管理和安裝 gems 的。bundle 是用來管理一個項目的 gems 的,確保能夠正確地安裝項目依賴,確保能夠運行正確的包。

相關文章:
主站蜘蛛池模板: 性欧美videos高清精品 | 日本欧美一区二区 | 91刘亦菲精品福利在线 | 在线观看免费视频网站色 | 一级毛片无毒不卡直接观看 | 波多野结衣在线视频免费观看 | 久久亚洲精品中文字幕二区 | 狠狠色狠狠色综合久久一 | 97青娱国产盛宴精品视频 | 一区二区三区四区在线播放 | 国产精品欧美亚洲 | 91久久国产综合精品女同国语 | 特级a毛片 | 米奇精品一区二区三区在线观看 | 一区二区中文字幕亚洲精品 | 欧美视频一区二区三区 | 高清国产一区二区三区 | 亚洲精品一区二三区在线观看 | 成人国产一区二区三区精品 | 特级毛片aaaa免费观看 | 亚洲日本精品 | 欧美色视频日本片免费高清 | 日本理论片午夜论片 | 全国最大色成免费网站 | 日韩精品一区二区三区乱码 | 久久思| 自怕偷自怕亚洲精品 | 国产a级高清版毛片 | 91香蕉国产在线观看免费永久 | 免费视频观看在线www日本 | 欧美中文字幕 | 亚洲日本高清 | 免费在线亚洲视频 | 亚洲成a人伦理 | 国产成人aa在线视频 | 亚洲欧美成人 | 欧美一级一级片 | 日韩欧美一区二区三区免费看 | 国产成人亚洲综合无 | 免费一看一级毛片全播放 | 一区二区三区免费视频播放器 |