0
這是我得到的錯誤:紅寶石JSON寶石(1.1.3)安裝失敗
MacBook-Pro:myapp marcamilly$ gem install json -v 1.1.3
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
creating Makefile
make
gcc -I. -I/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/x86_64-darwin10.4.0 -I/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/ruby/backward -I/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -Wall -o parser.o -c parser.c
parser.rl:2:16: error: re.h: No such file or directory
In file included from parser.rl:3:
/Users/marcamilly/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/ruby/backward/st.h:2:2: warning: #warning use "ruby/st.h" instead of bare "st.h"
parser.rl: In function ‘cParser_initialize’:
parser.rl:499: error: ‘struct RHash’ has no member named ‘tbl’
parser.rl:511: error: ‘struct RHash’ has no member named ‘tbl’
parser.rl:518: error: ‘struct RHash’ has no member named ‘tbl’
make: *** [parser.o] Error 1
Gem files will remain installed in /Users/marcamilly/.rvm/gems/ruby-1.9.2-p0/gems/json-1.1.3 for inspection.
Results logged to /Users/marcamilly/.rvm/gems/ruby-1.9.2-p0/gems/json-1.1.3/ext/json/ext/parser/gem_make.out
什麼有什麼想法我怎麼能解決這個問題?
我相信我可能已經安裝了json作爲另一個項目(一個Rails項目)之前的一部分,但現在我試圖安裝這個特定的,用於Sinatra,這是我得到的錯誤。
謝謝。
爲什麼在JSON是ruby標準庫的一部分時安裝json gem http://rubydoc.info/stdlib/json/1.9.2/JSON –
@ user420504因爲我正在處理的特定項目需要確切的版本上班。 – marcamillion