亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

mysql - 安裝gem報(bào)錯(cuò)

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

問(wèn)題描述

1.相應(yīng)的環(huán)境:  ubuntu12.04 ruby 2.4 2.通過(guò) 

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

安裝gem的時(shí)候報(bào)錯(cuò):

 

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.

于是我就手動(dòng)安裝了gem install json -v ’1.8.1’ ,依然報(bào)錯(cuò):

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,我只是安裝依賴(lài)ruby的軟件時(shí)候遇到的。請(qǐng)哪位大神幫忙看一下,該問(wèn)題應(yīng)該怎么解決?還有講講ruby , gem , ruby-rails,bundle之間的關(guān)系!謝謝!

問(wèn)題解答

回答1:

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

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

升級(jí) json 到 1.8.5 版本。執(zhí)行 bundle update json,然后 bundle install。因?yàn)椴恢滥愕?Gemfile 是怎么寫(xiě)的,無(wú)法確定有沒(méi)有明確依賴(lài) 1.8.1 版本。所以這個(gè)方法不一定成功。

Ruby 是語(yǔ)言。gem 是一組 Ruby 程序,類(lèi)似于「包」的概念。RubyGems 是 Ruby 的包管理器,用來(lái)管理和安裝 gems 的。bundle 是用來(lái)管理一個(gè)項(xiàng)目的 gems 的,確保能夠正確地安裝項(xiàng)目依賴(lài),確保能夠運(yùn)行正確的包。

相關(guān)文章:
主站蜘蛛池模板: 精品日韩一区二区 | 国产69精品久久久久777 | 奇米色88欧美一区二区 | 亚洲欧美日韩精品久久奇米色影视 | 黄色免费观看 | 久久久久久久久66精品片 | 94在线成人免费视频 | 免费的污污网站 | 成人福利在线免费观看 | 国产91在线chines看 | 成人黄18免费网站 | 精品成人免费一区二区在线播放 | 热久久最新地址 | 欧美日韩另类在线 | 日本一级毛片一级裸片 | 毛片大全在线 | 一区二区三区免费精品视频 | 人人干人人玩 | 国产一区二区在线观看免费 | 很黄的网站在线观看 | 精选国产门事件福利在线观看 | 五月天婷色 | 极品美女一级毛片 | 日本免费新一区二区三区 | 香蕉视频在线观看免费国产婷婷 | 成年视频在线观看免费 | 欧美黑寡妇香蕉视频 | www一级毛片| 国产精品一区二区手机看片 | 午夜在线播放免费人成无 | 天堂亚洲国产日韩在线看 | 丝袜足液精子免费视频 | 日韩一级片免费看 | 伊人久久综合影院首页 | 黄色在线 | a一区二区三区视频 | 国产免费小视频 | 免费一级生活片 | 日本一视频一区视频二区 | 三级毛片网站 | 国产在热线精品视频国产一二 |