繁体   English   中英

在Ruby 1.9.3中安装Mongrel

[英]Install Mongrel in Ruby 1.9.3

如何成功安装Mongrel for 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及更高版本兼容吗?

你不是一个人。 但是,在线程中,有一个指向可能的fix的链接 我没有尝试过YMMV,但似乎是可行的修复。

但是,鉴于Mongrel不再被更新,为什么不切换到Thin之类的东西呢?

编辑:对不起,我看到你问的是1.9.3。 我的理解是,Mongrel可以(最多)兼容1.9.1,但在1.9.2+中却被打破。 切换到更现代,更维护的又一个好理由。

在命令下

gem install mongrel --pre

效果很好。

参考: 请查看此链接以获取更多详细信息

如John B所述,切换到Thin。

在无法使用当前的Ruby 1.9.3设置安装Mongrel后,我从Gemfile中注释掉了Mongrel并添加了Thin。 这使我的应用程序可以完全安装并运行良好。

在我的Gemfile中

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

然后跑

bundle install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM