-->

在Ruby中1.9.3安装杂种(Install Mongrel in Ruby 1.9.3)

2019-07-05 02:16发布

我怎样才能成功安装杂种红宝石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及以上兼容吗?

Answer 1:

你不是一个人。 在线程,然而,有一个可能的修复程序的链接 。 我没有尝试过这么因人而异,但它似乎是一个合理的定位。

鉴于杂种不再被更新,不过,为什么不切换到像薄 ?

编辑:对不起,我看到你问1.9.3。 我的理解是杂种是(应该是)高达1.9.1兼容,但在1.9.2+打破。 另一个很好的理由以切换到更现代的东西和维护。



Answer 2:

下面的命令,

gem install mongrel --pre

效果很好。

裁判: 检查此链接了解更多详情



Answer 3:

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

不能够得到的杂种狗我的当前设置使用Ruby 1.9.3安装后,我从我的Gemfile注释掉杂种并添加薄。 这让我的应用程序完全安装并运行大。

在我的Gemfile

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

然后运行

bundle install


文章来源: Install Mongrel in Ruby 1.9.3