2012-12-13 30 views
9

Làm thế nào tôi có thể thành công cài đặt mongrel cho ruby ​​1.9.3Install mongrel trong Ruby 1.9.3

Dưới đây là các lỗi:

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 

Tôi đã cố gắng sudo gem install mongrel --pre và thậm chí một trong đó có --source

Tôi không biết tại sao nó không hoạt động. Nó có tương thích với Ruby 1.9.1 trở lên không?

Trả lời

10

You are not alone. Trong chuỗi, tuy nhiên, có a link to a possible fix. Tôi chưa thử YMMV, nhưng nó có vẻ như là một sửa chữa hợp lý.

Vì Mongrel không còn được cập nhật, tuy nhiên, tại sao không chuyển sang một cái gì đó như Thin?

Chỉnh sửa: Xin lỗi, tôi thấy bạn đang hỏi về 1.9.3. Sự hiểu biết của tôi là Mongrel là (được cho là) ​​tương thích với lên đến 1.9.1, nhưng bị phá vỡ trong 1.9.2+. Tuy nhiên, một lý do khác để chuyển sang một cái gì đó hiện đại hơn và được duy trì.

1

Như John B đã nói, hãy chuyển sang chế độ Mỏng.

Sau khi không thể cài đặt Mongrel cài đặt với thiết lập hiện tại của tôi với Ruby 1.9.3, tôi nhận xét ra Mongrel từ Gemfile của tôi và thêm Thin. Điều này cho phép ứng dụng của tôi cài đặt và chạy hoàn toàn.

Trong Gemfile tôi

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

sau đó chạy

bundle install 
Các vấn đề liên quan