2012-12-13 92 views
9

我怎樣才能成功安裝雜種對Ruby 1.9.3在Ruby中安裝雜種1.9.3

這裏的錯誤:

Building native extensions. This could take a while... 
ERROR: Error installing mongrel: 
    ERROR: Failed to build gem native extension. 

     /usr/bin/ruby1.9.1 extconf.rb 
checking for main() in -lc... yes 
creating Makefile 

make 
compiling http11_parser.c 
compiling http11.c 
http11.c: In function ‘http_field’: 
http11.c:70:3: error: format not a string literal and no format arguments [-Werror=format-security] 
http11.c:71:3: error: format not a string literal and no format arguments [-Werror=format-security] 
http11.c:77:22: error: ‘struct RString’ has no member named ‘ptr’ 
http11.c:77:50: error: ‘struct RString’ has no member named ‘len’ 
http11.c:77:27: warning: left-hand operand of comma expression has no effect [-Wunused-value] 
http11.c: In function ‘request_uri’: 
http11.c:102:3: error: format not a string literal and no format arguments [-Werror=format-security] 
http11.c: In function ‘fragment’: 
http11.c:113:3: error: format not a string literal and no format arguments [-Werror=format-security] 
http11.c: In function ‘request_path’: 
http11.c:124:3: error: format not a string literal and no format arguments [-Werror=format-security] 
http11.c: In function ‘query_string’: 
http11.c:135:3: error: format not a string literal and no format arguments [-Werror=format-security] 
http11.c: In function ‘header_done’: 
http11.c:172:13: error: ‘struct RString’ has no member named ‘ptr’ 
http11.c:172:13: error: ‘struct RString’ has no member named ‘ptr’ 
http11.c:172:13: error: ‘struct RString’ has no member named ‘ptr’ 
http11.c:174:89: error: ‘struct RString’ has no member named ‘ptr’ 
http11.c:176:52: error: ‘struct RString’ has no member named ‘ptr’ 
http11.c:177:26: error: ‘struct RString’ has no member named ‘len’ 
http11.c: In function ‘HttpParser_execute’: 
http11.c:298:23: error: ‘struct RString’ has no member named ‘ptr’ 
http11.c:299:23: error: ‘struct RString’ has no member named ‘len’ 
http11.c:307:5: error: format not a string literal and no format arguments [-Werror=format-security] 
cc1: some warnings being treated as errors 
make: *** [http11.o] Error 1 


Gem files will remain installed in /var/lib/gems/1.9.1/gems/mongrel-1.1.5 for inspection. 
Results logged to /var/lib/gems/1.9.1/gems/mongrel-1.1.5/ext/http11/gem_make.out 

我已經嘗試過sudo gem install mongrel --pre 甚至有--source

的一個

我不知道爲什麼它不工作。它是否與Ruby 1.9.1兼容?

回答

10

You are not alone.在線程,然而,有a link to a possible fix。我沒有嘗試過,所以YMMV,但它似乎是一個似是而非的修復。

鑑於雜種不再被更新,不過,爲什麼不改用類似Thin

編輯:對不起,我看到你問1.9.3。我的理解是雜種是(應該是)高達1.9.1兼容,但在1.9.2+打破。還有一個很好的理由轉向更現代化的東西和維護。

1

正如John乙所述,切換到薄。

由於無法使用Ruby 1.9.3安裝Mongrel進行安裝,因此我從Gemfile中註釋了Mongrel並添加了Thin。這讓我的應用程序完全安裝並運行良好。

在我的Gemfile

#gem 'mongrel', '1.2.0.pre2' 
gem 'thin' 

然後運行

bundle install 
相關問題